返回列表 發帖
  1. import java.util.Scanner;


  2. public class JPA01 {
  3.           static Scanner o= new Scanner(System.in);
  4.         public static void main(String[] args) {
  5.                 // TODO 自動產生的方法 Stub
  6.                
  7.                 test();
  8.                 test();
  9.                 test();
  10.                 test();
  11.                 test();
  12.                 }
  13.                
  14.           
  15.         private static void test() {
  16.                 // TODO 自動產生的方法 Stub
  17.                
  18.                  
  19.                
  20.                  System.out.print("Input  score:");
  21.                  int c = o.nextInt();
  22.                 
  23.                
  24.                if(c>=90)
  25.                           {
  26.                                   System.out.println("Your grade is A");
  27.                           }
  28.                if(c>=80)
  29.                           {
  30.                                   System.out.println("Your grade is B");
  31.                           }
  32.                
  33.                if(c>=70)
  34.                           {
  35.                                   System.out.println("Your grade is C");
  36.                           }
  37.                if(c>=60)
  38.                           {
  39.                                   System.out.println("Your grade is D");
  40.                           }
  41.                if(c<60)
  42.                           {
  43.                                   System.out.println("Your grade is F");
  44.                           }
  45.              
  46.         }
  47.        

  48. }
複製代碼

TOP

返回列表