Page 3 of 3

Re: 11777 - Automate the Grades Why getting WA???

Posted: Mon Jul 28, 2014 7:30 pm
by brianfry713
That's the way it was done for me in the USA.

Re: 11777 - Automate the Grades

Posted: Tue Jan 06, 2015 8:18 pm
by shafin_ohin
Why WA??

Code: Select all

#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main()
{
    long int t1,t2,f,a,ct1,ct2,ct3,t,sum=0,i,k=1;
    cin>>t;
while(t--)
{
    cin>>t1>>t2>>f>>a>>ct1>>ct2>>ct3;
    sum=t1+t2+f+a;
    if(ct1==ct2&&ct2==ct3)
    sum+=(ct1+ct2)/2;
    else
    {
        if(ct1>ct2&&ct1>ct3&&ct2>ct3)
        sum+=(ct1+ct2)/2;
        else if(ct2>ct1&&ct2>ct3&&ct1>ct3)
        sum+=(ct1+ct2)/2;
        else if(ct2>ct1&&ct2>ct3&&ct3>ct1)
        sum+=(ct2+ct3)/2;
        else if(ct3>ct2&&ct3>ct1&&ct2>ct1)
        sum+=(ct2+ct3)/2;
        else if(ct1>ct2&&ct1>ct3&&ct3>ct2)
        sum+=(ct1+ct3)/2;
        else
        sum+=(ct1+ct3)/2;
    }
    printf("Case %ld: ",k++);
    if(sum>=90)
    printf("A\n");
    else if(sum>=80)
    printf("B\n");
    else if(sum>=70)
    printf("C\n");
    else if(sum>=60)
    printf("D\n");
    else
    printf("F\n");
    sum=0;
}
return(0);
}

Re: 11777 - Automate the Grades

Posted: Wed Jan 07, 2015 3:14 am
by brianfry713
Try the I/O in this thread.