标签:style blog io color os sp for 数据 div
2
2
2000 30 123456789
2000 20 987654321
4
3000 50 872198442
3000 45 752498124
2000 60 765128742
3000 45 652278122
987654321
752498124
1 #include <stdio.h> 2 3 int main(){ 4 int T; 5 int n; 6 int a; 7 int b; 8 int c; 9 int i; 10 int a_max; 11 int b_min; 12 int c_max; 13 14 scanf("%d",&T); 15 16 while(T--){ 17 scanf("%d",&n); 18 19 for(i=0;i<n;i++){ 20 scanf("%d%d%d",&a,&b,&c); 21 22 if(i==0){ 23 a_max=a; 24 b_min=b; 25 c_max=c; 26 continue; 27 } 28 29 if(a>a_max){ 30 a_max=a; 31 b_min=b; 32 c_max=c; 33 } 34 35 else if(a==a_max){ 36 if(b<b_min){ 37 a_max=a; 38 b_min=b; 39 c_max=c; 40 } 41 42 else if(b==b_min){ 43 if(c>c_max){ 44 a_max=a; 45 b_min=b; 46 c_max=c; 47 } 48 } 49 } 50 } 51 52 printf("%d\n",c_max); 53 } 54 return 0; 55 }
标签:style blog io color os sp for 数据 div
原文地址:http://www.cnblogs.com/zqxLonely/p/4098400.html