-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathProgram.cs
30 lines (26 loc) · 840 Bytes
/
Program.cs
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
using System;
namespace Grading_Students {
class Program {
public static int GradingStudent(int grade) {
if (grade < 38) {
return grade;
} else {
int mod = (grade % 5);
if (mod == 0) {
return grade;
} else if ((5 - mod) < 3) {
return grade + (5 - mod);
} else {
return grade;
}
}
}
static void Main(string[] args) {
int gradesCount = Convert.ToInt32(Console.ReadLine().Trim());
for (int i = 0; i < gradesCount; i++) {
int gradesItem = Convert.ToInt32(Console.ReadLine().Trim());
Console.WriteLine(GradingStudent(gradesItem));
}
}
}
}