返回列表 發帖

201

import java.util.Scanner;
public class JPA02 {
    static Scanner keyboard = new Scanner(System.in);
   
    public static void main(String[] args) {
        test();
        test();
    }
   
    public static void test() {
        ...
    }
}
Stay hungry,
Stay foolish.

  1. package date0605;
  2. import java.util.Scanner;
  3. public class JPA02
  4. {
  5.         static Scanner keyboard = new Scanner(System.in);
  6.     public static void main(String[] args)
  7.     {
  8.         test();
  9.         System.out.println("End");
  10.         test();
  11.         System.out.println("End");
  12.     }
  13.    
  14.     public static void test()
  15.     {
  16.             int num;
  17.             System.out.println("Please enter score:");
  18.             num = keyboard.nextInt();
  19.             if(num>60)
  20.             {
  21.                     System.out.println("You pass");
  22.             }
  23.     }
  24. }
複製代碼

TOP

  1. package hi87;

  2. import java.util.Scanner;
  3. public class JPA02 {
  4.         static Scanner s=new Scanner(System.in);
  5.    
  6.     public static void main(String[] args) {
  7.         test();
  8.         test();
  9.     }
  10.    
  11.     public static void test() {
  12.             System.out.print("Please enter score :");
  13.             Scanner s=new Scanner(System.in);
  14.             int ss=s.nextInt();
  15.             if(ss>=60)
  16.             {
  17.                     System.out.println("You pass");
  18.            
  19.             }       
  20.             System.out.println("End");
  21.     }
  22. }
複製代碼

TOP

本帖最後由 巫沛庭 於 2018-6-5 20:00 編輯
  1. import java.util.Scanner;       
  2. public class JPA02 {
  3.    static Scanner keyboard = new Scanner(System.in);
  4.    public static void main(String[] args)
  5.    {
  6.     test();
  7.     test();
  8.    }
  9.    public static void test()
  10.    {
  11.         int a;
  12.     System.out.println("Please enter score :");
  13.     a=keyboard.nextInt();
  14.     if(a>=60)
  15.     {
  16.       System.out.println("You pass");
  17.     }
  18.     System.out.println("End");
  19.    }
  20.   }
複製代碼

TOP

package dwaawd;

import java.util.Scanner;

public class wdawdawad {
         static Scanner keyboard = new Scanner(System.in);
            
            public static void main(String[] args) {
                test();
                test();
            }
            
            public static void test() {
                    System.out.print("Please enter score");
                     int s= keyboard.nextInt();
                    if(s>=60)
            {
                    System.out.println("You pass");
                   
            }
                    System.out.println("End");
                           
        }

}

TOP

返回列表