[HackerRank] Grading Students
954 ワード
[質問]
Sam is a professor at the university and likes to round each student's according to these rules:
[入力]
The first line contains a single integer n , the number of students.
Each line i of the n subsequent lines contains a single integer, grades[i].
[出力]
int[n] : the grades after rounding as appropriate.
[コード]
def gradingStudents(grades):
# Write your code here
for i in range(len(grades)):
if(grades[i]<38):
continue
else:
up = (grades[i]//5)+1;
if((up*5) - grades[i] < 3):
grades[i] = up*5
return grades
Reference
この問題について([HackerRank] Grading Students), 我々は、より多くの情報をここで見つけました https://velog.io/@jongmin97/HackerRank-Grading-Studentsテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol