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


  2. public class OP321 {
  3.            static Scanner keyboard = new Scanner(System.in);
  4.             public static void main(String[] args) {
  5.                 test();        
  6.                 test();
  7.                 test();
  8.                 test();
  9.             }
  10.             
  11.             static void test() {
  12.                 int chi, eng, math, avg;
  13.                 System.out.print("Input Chinese score:");
  14.                 chi = keyboard.nextInt();
  15.                 System.out.print("Input English score:");
  16.                 eng = keyboard.nextInt();
  17.                 System.out.print("Input Math score:");
  18.                 math = keyboard.nextInt();
  19.                 
  20.                 if(chi<60)
  21.                 {
  22.                         System.out.println("Chinese failed");       
  23.                 }
  24.                  if(eng<60)
  25.                 {
  26.                         System.out.println("English failed");       
  27.                 }
  28.                 if(math<60)
  29.                 {
  30.                         System.out.println("Math failed");       
  31.                 }
  32.                 if(chi>=60&&eng>=60&&math>=60)
  33.                 {
  34.                         System.out.println("All Pass");       
  35.                 }
  36.                 }
  37.             }
複製代碼

TOP

返回列表