首页 > 代码库 > 2013ACM/ICPC亚洲区南京站现场赛——题目重现

2013ACM/ICPC亚洲区南京站现场赛——题目重现

GPA http://acm.hdu.edu.cn/showproblem.php?pid=4802

签到题,输入两个表,注意细心点就行了。

 1 #include<cstdio> 2 #include<cstring> 3 const int M=16; 4 char s[M],cp[M][M]={"A","A-","B+","B","B-","C+","C","C-","D","D-","F"}; 5 double si[]={4,3.7,3.3,3,2.7,2.3,2,1.7,1.3,1.0,0}; 6 int main(){ 7     int n; 8     while(~scanf("%d",&n)){ 9         double ss=0;10         int sc=0,c;11         while(n--){12             scanf("%d%s",&c,s);13             for(int i=0;i<11;i++){14                 if(!strcmp(cp[i],s)){15                     ss+=si[i]*c;16                     sc+=c;17                     break;18                 }19             }20         }21         if(!sc){22             puts("0.00");23             continue;24         }25         printf("%.2f\n",ss/sc);26     }27     return 0;28 }
View Code

 

 

 

end

 

2013ACM/ICPC亚洲区南京站现场赛——题目重现