- import java.util.*;
- public class JPD02 {
- static Scanner keyboard = new Scanner(System.in);
- public static void main(String[] args) {
- test();
- test();
- test();
- test();
- }
-
- static void test() {
- int chi, eng, math, avg;
- System.out.print("Input Chinese score:");
- chi = keyboard.nextInt();
- System.out.print("Input English score:");
- eng = keyboard.nextInt();
- System.out.print("Input Math score:");
- math = keyboard.nextInt();
-
- if(chi>59 && eng>59 && math>59)
- System.out.println("All pass.");
- else if(chi <60)
- System.out.println("Chinese failed.");
- else if(eng <60)
- System.out.println("english failed.");
- else if(math <60)
- System.out.println("math failed.");
-
- }
- }
複製代碼 |