-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathp11777.cpp
33 lines (31 loc) · 854 Bytes
/
p11777.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
#define sf scanf
#define pf printf
int main()
{
int t, term1, term2, finalE, attendance, cTest, a[3], i, j, result;
sf("%d", &t);
for(i=1; i<=t; i++) {
sf("%d %d %d %d", &term1, &term2, &finalE, &attendance);
for(j=0; j<3; j++) {
sf("%d", &a[j]);
}
sort(a, a+3);
cTest = (a[1]+a[2])/2;
result = term1 + term2 + finalE + attendance + cTest;
if(result>=90) {
pf("Case %d: A\n", i);
}else if(result>=80) {
pf("Case %d: B\n", i);
}else if(result>=70) {
pf("Case %d: C\n", i);
}else if(result>=60) {
pf("Case %d: D\n", i);
}else {
pf("Case %d: F\n", i);
}
}
}