标签:style blog http io color ar os sp for
1
4
YaoLin 87 82 Y N 0
ChenRuiyi 88 78 N Y 1
LiXin 92 88 N N 0
ZhangQin 83 87 Y N 1
ChenRuiyi
9000
28700
1 #include <stdio.h> 2 #include <string.h> 3 4 int main(){ 5 int T; 6 int n; 7 char name[30]; 8 int grade1; 9 int grade2; 10 char cadres; 11 char west; 12 int number; 13 int i; 14 int amount; 15 int max; 16 int sum; 17 char temp[30]; 18 19 scanf("%d",&T); 20 21 while(T--){ 22 scanf("%d",&n); 23 24 sum=0; 25 for(i=0;i<n;i++){ 26 scanf("%s%d%d %c %c%d",&name,&grade1,&grade2,&cadres,&west,&number); 27 28 amount=0; 29 30 if(grade1>80 && number>=1) 31 amount+=8000; 32 33 if(grade1>85 && grade2>80) 34 amount+=4000; 35 36 if(grade1>90) 37 amount+=2000; 38 39 if(grade1>85 && west==‘Y‘) 40 amount+=1000; 41 42 if(grade2>80 && cadres==‘Y‘) 43 amount+=850; 44 45 sum+=amount; 46 47 if(i==0){ 48 max=amount; 49 strcpy(temp,name); 50 continue; 51 } 52 53 if(amount>max){ 54 max=amount; 55 strcpy(temp,name); 56 } 57 } 58 59 printf("%s\n%d\n%d\n",temp,max,sum); 60 } 61 62 63 return 0; 64 }
标签:style blog http io color ar os sp for
原文地址:http://blog.csdn.net/dazirandenvhai/article/details/41144907