Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int t,a,b,d,e,f,c1,c2,c3,sum,i;
- while(scanf("%d",&t)==1)
- {
- for(i=1;i<=t;i++)
- {
- scanf("%d%d%d%d%d%d%d",&a,&b,&d,&e,&c1,&c2,&c3);
- if(c1>=c2&&c2>=c3||c2>=c1&&c1>=c3)
- {
- f=(c1+c2)/2;
- }
- else if(c2>=c3&&c3>=c1||c3>=c2&&c2>=c1)
- {
- f=(c2+c3)/2;
- }
- else if(c1>=c3&&c3>=c2||c3>=c1&&c1>=c2)
- {
- f=(c1+c3)/2;
- }
- sum=a+b+d+e+f;
- if(sum>=90)
- {
- printf("Case %d: A\n",i);
- }
- else if(sum>=80)
- {
- printf("Case %d: B\n",i);
- }
- else if(sum>=70)
- {
- printf("Case %d: C\n",i);
- }
- else if(sum>=60)
- {
- printf("Case %d: D\n",i);
- }
- else if(sum<60)
- {
- printf("Case %d: F\n",i);
- }
- }
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment