11777 - Automate the Grades
Moderator: Board moderators
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 11777 - Automate the Grades Why getting WA???
That's the way it was done for me in the USA.
Check input and AC output for thousands of problems on uDebug!
-
- New poster
- Posts: 2
- Joined: Tue Jan 06, 2015 1:54 pm
Re: 11777 - Automate the Grades
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
Reason: Added code blocks
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 11777 - Automate the Grades
Try the I/O in this thread.
Check input and AC output for thousands of problems on uDebug!