Skip to content

Instantly share code, notes, and snippets.

@torpedo87
Last active March 3, 2017 01:38
Show Gist options
  • Save torpedo87/fa984b6362b23ea65e2fa220477406bf to your computer and use it in GitHub Desktop.
Save torpedo87/fa984b6362b23ea65e2fa220477406bf to your computer and use it in GitHub Desktop.
##[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