Problem Link
Solution :-
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
/*------------------------------------------------*/ //Problem Setter: Sohel Hafiz //Uva Problem No: 11777 //Problem Name : Automate the Grades //Type : Ad hoc //Author : Shipu Ahamed //University : BUBT //E-mail : shipuahamed01@gmail.com /*-----------------------------------------------*/ #include<stdio.h> int main() { int t1,t2,f,at,ct1,ct2,ct3,c,d,n,i; while(scanf("%d",&n)==1) { for(i=1;i<=n;i++) { scanf("%d%d%d%d%d%d%d",&t1,&t2,&f,&at,&ct1,&ct2,&ct3); if(ct1<=ct2 && ct1<=ct3) c=(ct2+ct3)/2; else if(ct2<=ct1 && ct2<=ct3) c=(ct1+ct3)/2; else if(ct3<=ct1 && ct3<=ct2) c=(ct1+ct2)/2; d=t1+t2+f+at+c; if(d>=90) printf("Case %d: An",i); else if(d>=80) printf("Case %d: Bn",i); else if(d>=70) printf("Case %d: Cn",i); else if(d>=60) printf("Case %d: Dn",i); else if(d<60) printf("Case %d: Fn",i); } } return 0; } |