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


public class JPA01 {
          static Scanner o= new Scanner(System.in);
        public static void main(String[] args) {
                // TODO 自動產生的方法 Stub
               
                test();
                test();
                test();
                test();
               
                       
                }
               
          
        private static void test() {
                // TODO 自動產生的方法 Stub
               
                 
               
                 System.out.print("Input Chinese score:");
                 int c = o.nextInt();
                
                System.out.print("Input English score:");
                int e = o.nextInt();
                System.out.print("Input Math score:");
               int  m = o.nextInt();
               if(c<60)
                          {
                                  System.out.println("Chinese failed");
                          }
                  if(e<60)
                  {
                          System.out.println("English failed");
                  }
                  if(m<60)
                  {
                          System.out.println("Math failed");
                  }
                  else
                  {
                          System.out.println("All past");  
                  }
        }
       

}

TOP

返回列表