You are viewing a single comment's thread. Return to all comments →
Here is my solution with C#:
static int solve(int grade){ int result = grade; if (grade >= 38) { if ((5 - (grade % 5) + grade) - grade < 3) result = 5 - (grade % 5) + grade; } return result; } static void Main(String[] args) { int n = Convert.ToInt32(Console.ReadLine()); int[] grades = new int[n]; for(int grades_i = 0; grades_i < n; grades_i++){ grades[grades_i] = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(solve(grades[grades_i])); } }
Seems like cookies are disabled on this browser, please enable them to open this website
Grading Students
You are viewing a single comment's thread. Return to all comments →
Here is my solution with C#: