11777 - Automate the Grades

All about problems in Volume 117. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

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

Post by brianfry713 » Mon Jul 28, 2014 7:30 pm

That's the way it was done for me in the USA.
Check input and AC output for thousands of problems on uDebug!

shafin_ohin
New poster
Posts: 2
Joined: Tue Jan 06, 2015 1:54 pm

Re: 11777 - Automate the Grades

Post by shafin_ohin » Tue Jan 06, 2015 8:18 pm

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);
}
Last edited by brianfry713 on Wed Jan 07, 2015 12:23 am, edited 1 time in total.
Reason: Added code blocks

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 11777 - Automate the Grades

Post by brianfry713 » Wed Jan 07, 2015 3:14 am

Try the I/O in this thread.
Check input and AC output for thousands of problems on uDebug!

Post Reply

Return to “Volume 117 (11700-11799)”