- import java.util.*;
- class JPD02 {
- static Scanner keyboard = new Scanner(System.in);
- public static void main(String[] args) {
- test();
- test();
- test();
- test();
- test();
- }
-
- public static void test() {
- System.out.println("Input:");
- int s = keyboard.nextInt();
- if(s>=90)
- {
- System.out.println("Your grade is A");
- }
- else if(90>s & s>=80)
- {
- System.out.println("Your grade is B");
- }
- else if(80>s & s>=70)
- {
- System.out.println("Your grade is C");
- }
- else if(70>s & s>=60)
- {
- System.out.println("Your grade is D");
- }
- else
- {
- System.out.println("Your grade is F");
- }
- }
- }
複製代碼 |