-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathw2_p1.cpp
More file actions
56 lines (47 loc) · 1.36 KB
/
Copy pathw2_p1.cpp
File metadata and controls
56 lines (47 loc) · 1.36 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include <bits/stdc++.h>
using namespace std;
int main()
{
cin.tie(nullptr), ios::sync_with_stdio(false);
int student_num;
int mid, fin, assign;
cin >> student_num;
int student[student_num];
for (int i = 0; i < student_num; i++)
{
cin >> mid >> fin >> assign;
int total_score;
total_score = mid * 2 + fin * 3 + assign * 5;
student[i] = total_score;
}
for (int i = 0; i < student_num; i++)
{
cout << student[i] << " ";
if (student[i] >= 950)
cout << "A+" << endl;
else if (student[i] >= 900)
cout << "A0" << endl;
else if (student[i] >= 850)
cout << "A-" << endl;
else if (student[i] >= 800)
cout << "B+" << endl;
else if (student[i] >= 750)
cout << "B0" << endl;
else if (student[i] >= 700)
cout << "B-" << endl;
else if (student[i] >= 600)
cout << "C+" << endl;
else if (student[i] >= 500)
cout << "C0" << endl;
else if (student[i] >= 400)
cout << "C-" << endl;
else if (student[i] >= 300)
cout << "D+" << endl;
else if (student[i] >= 200)
cout << "D0" << endl;
else if (student[i] >= 100)
cout << "D-" << endl;
else
cout << "F" << endl;
}
}