➽ Problem:-
https://www.hackerrank.com/challenges/grading/problem
➽ Solution:-
import
java.util.*;
import
java.io.*;
class
Solution
{
    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
        int num;
        num = sc.nextInt();
        
        for(int i=0; i<num; i++)
        {
            int grades;
            grades = sc.nextInt();
            if(grades >= 38 && grades % 5
>= 3)
            {
                grades += 5 - grades % 5;
            }
            System.out.println(grades);
        }
    }
}
 

 
0 Comments
Please do not enter any spam link in the comment section.