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