返回列表 發帖
  1. import java.util.*;
  2. public class JPA02 {
  3.     static Scanner input = new Scanner(System.in);
  4.     public static void main(String[] args) {
  5.         test();
  6.         test();
  7.     }
  8.    
  9.     static void test() {
  10.         System.out.println("Input a integer:");
  11.         int i = input.nextInt();
  12.         if(i%2==0)
  13.         {
  14.                 System.out.println("The number is even;");
  15.         }
  16.         else
  17.         {
  18.                 System.out.println("The number is odd");
  19.         }
  20.     }
  21. }
複製代碼

TOP

返回列表