标签:ios amp mamicode tab algo return ima while info
水题。
1 #include<iostream> 2 #include<algorithm> 3 using namespace std; 4 5 int main() { 6 int n,id,x,y, MIN = 0x3fffffff,MAX = -1,champion,vegetableBird; 7 cin>>n; 8 while(n--) { 9 cin>>id>>x>>y; 10 if(MIN > x*x+y*y) { 11 MIN = x*x+y*y; 12 champion = id; 13 } 14 if(MAX < x*x+y*y) { 15 MAX = x*x+y*y; 16 vegetableBird = id; 17 } 18 } 19 printf("%04d %04d",champion,vegetableBird); 20 return 0; 21 }
标签:ios amp mamicode tab algo return ima while info
原文地址:https://www.cnblogs.com/keep23456/p/12363251.html