You are viewing a single comment's thread. Return to all comments →
Javascript solution:
function solve(grades){ var index = 0; while(index < grades.length) { if (grades[index]%5 >=3 && grades[index] >37) { grades[index] = grades[index] - grades[index]%5 + 5; } ++index; } return grades; } function main() { var n = parseInt(readLine()); var grades = []; for(var grades_i = 0; grades_i < n; grades_i++){ grades[grades_i] = parseInt(readLine()); } var result = solve(grades); result.forEach(e => console.log(e)) // console.log(result.join(" "));
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 →
Javascript solution: