返回列表 發帖

206-及格成績

import java.util.*;
public class JPA02 {
    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();
        
        ...
    }
}
Stay hungry,
Stay foolish.

返回列表