Pabon_SEC

Automate the grades

Feb 17th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.94 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. int main()
  4. {
  5.     int t,t1,t2,fnl,att,ct1,ct2,ct3,i,a,b;
  6.  
  7.     scanf("%d",&t);
  8.  
  9.     for(i=1;i<=t;i++)
  10.     {
  11.         scanf("%d%d%d%d%d%d%d",&t1,&t2,&fnl,&att,&ct1,&ct2,&ct3);
  12.  
  13.         if(ct1<=ct2 && ct1<=ct3)
  14.         {
  15.             b=(ct2+ct3)/2;
  16.         }
  17.         else if(ct2<=ct3 && ct2<=ct1)
  18.         {
  19.             b=(ct1+ct3)/2;
  20.         }
  21.         else if(ct3<=ct1 && ct3<=ct2)
  22.         {
  23.             b=(ct1+ct2)/2;
  24.         }
  25.  
  26.         a=t1+t2+fnl+att+b;
  27.  
  28.         if(a>=90)
  29.         {
  30.             printf("Case %d: A\n",i);
  31.         }
  32.         else if(a>=80 && a<90)
  33.         {
  34.             printf("Case %d: B\n",i);
  35.         }
  36.         else if(a>=70 && a<80)
  37.         {
  38.             printf("Case %d: C\n",i);
  39.         }
  40.         else if(a>=60 && a<70)
  41.         {
  42.             printf("Case %d: D\n",i);
  43.         }
  44.         else if(a<60)
  45.         {
  46.             printf("Case %d: F\n",i);
  47.         }
  48.     }
  49.     return 0;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment