返回列表 發帖
  1. import java.util.*;
  2.         public class JPA02{
  3.                 static Scanner keyboard = new Scanner(System.in);
  4.                 public static void main(String[] args) {
  5.                         test();
  6.                         test();
  7.                         test();
  8.                         test();
  9.                         test();
  10.                 }
  11.                 public static void test() {
  12.                         System.out.println("Input:");
  13.                         int g = keyboard.nextInt();
  14.                         if (g>=90)System.out.println("Your grade is A");
  15.                         else if (g>=80)System.out.println("Your grade is B");
  16.                         else if (g>=70)System.out.println("Your grade is C");
  17.                         else if (g>=60)System.out.println("Your grade is D");
  18.                         else System.out.println("Your grade is F");
  19.                 }
  20. }
複製代碼

TOP

返回列表