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 41 42 43 44 45 46 |
#include <iostream> #include <cstdio> #include <sstream> #include <string> using namespace std; int main() { int tt,kase=1; double s,a,MN,avg; cin>>tt; while(tt--) { MN=25; s = 0; avg = 0; for(int i=0;i<4;i++) { cin>>a; s+=a; } for(int i=0;i<3;i++) { cin>>a; avg+=a; if(a<MN) MN=a; } avg-=MN; avg/=2; s+=avg; if(s>=90) cout<<"Case "<<kase++<<": A\n"; else if(s>=80) cout<<"Case "<<kase++<<": B\n"; else if(s>=70) cout<<"Case "<<kase++<<": C\n"; else if(s>=60) cout<<"Case "<<kase++<<": D\n"; else cout<<"Case "<<kase++<<": F\n"; } return 0; } |