... HAVE U TRIED .... AT LEAST 3 TIMES ... OK U CAN SEE THIS ...

Tuesday, December 24, 2013

UVA-11777 :: Automate the Grades

#include <bits/stdc++.h>
using namespace std ;

int main ()
{
    int a[100] , j ,i ,t ,x ,b ,min ;
    double v ,sum ;

    cin>>t ;
      for (i=1 ; i<=t ; i++)
    {
        sum=0 ;
        min=20 ;
        x =0 ;
        for (j=0 ; j<7  ; j++)
        {
            cin>>b ;
            a[j] = b ;
            if (j<4) sum=sum+a[j] ;

            if (j>3)
            {
                x=x+a[j] ;
                if (min>=a[j]) min=a[j] ;
            }
        }

        x=x-min ;
        v= x/2.00 ;
        sum = sum+v ;

       if (sum>=90.0) cout<<"Case"<<" "<<i<<":"<<" "<<"A"<<endl;
       else  if (sum>=80.0 && sum<90.0) cout<<"Case"<<" "<<i<<":"<<" "<<"B"<<endl;
       else  if (sum>=70.0 && sum<80.0) cout<<"Case"<<" "<<i<<":"<<" "<<"C"<<endl;
       else  if (sum>=60.0 && sum<70.0) cout<<"Case"<<" "<<i<<":"<<" "<<"D"<<endl;
       else  if ( sum<60.0) cout<<"Case"<<" "<<i<<":"<<" "<<"F"<<endl;

    }

    return 0 ;
}