Last active
March 3, 2017 01:38
-
-
Save torpedo87/fa984b6362b23ea65e2fa220477406bf to your computer and use it in GitHub Desktop.
[grading students](https://www.hackerrank.com/challenges/grading)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##[grading students](https://www.hackerrank.com/challenges/grading) | |
```javascript | |
function main() { | |
var n = parseInt(readLine()); | |
//console.log(n); | |
for(var i = 0; i < n; i++){ | |
var grade = parseInt(readLine()); | |
// your code goes here | |
if(grade<38){ | |
grade=grade; | |
}else if((5-grade%5)<3){ | |
grade=(grade-grade%5)+5; | |
} | |
console.log(grade); | |
} | |
} | |
``` | |
*** |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment