返回列表 發帖

202

import java.util.*;
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.         test();
  10.     }
  11.    
  12.     public static void test()
  13.     {
  14.             int num,num1;
  15.             System.out.println("Input:");
  16.             num = keyboard.nextInt();
  17.             num1 = keyboard.nextInt();
  18.             if(num>num1)
  19.             {
  20.                     System.out.println(num+" is larger than "+num1);
  21.             }
  22.             if(num<num1)
  23.             {
  24.                     System.out.println(num1+" is larger than "+num);
  25.             }
  26.             if(num==num1)
  27.             {
  28.                     System.out.println(num+" equal to "+num1);
  29.             }
  30.     }
  31. }
複製代碼

TOP

  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,b;
  12.     System.out.println("Input :");
  13.     a=keyboard.nextInt();
  14.     b=keyboard.nextInt();
  15.     if(a>b)
  16.     {
  17.       System.out.println(a+" is larger than "+b);
  18.     }
  19.     else if(a<b)
  20.     {
  21.       System.out.println(b+" is larger than "+a);
  22.     }
  23.     else if(a==b)
  24.     {
  25.       System.out.println(a+"equal"+b);
  26.     }
  27.    }
  28.   }
複製代碼

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("Input:");
                     int s= keyboard.nextInt();
                     int o= keyboard.nextInt();
                    if(s>o)
            {
                    System.out.println(s+" is larger than " +o);
                   
            }
                   
                    if( o>s)
                    {
                            System.out.println(o+" is larger than "+s);
                           
                    }
                           
        }

}

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.     System.out.println("Input:");
  8.     int ss=s.nextInt();
  9.     int mm=s.nextInt();
  10.     if(ss>mm)
  11.     {
  12.              System.out.println(ss+" is larger than "+mm);
  13.     }
  14.     else if(ss<mm)
  15.     {
  16.              System.out.println(mm+" is larger than "+ss);
  17.     }
  18.     else
  19.     {
  20.              System.out.println(ss+" equal "+mm);
  21.     }
  22.     System.out.println("Input:");
  23.     int oo=s.nextInt();
  24.     int pp=s.nextInt();
  25.     if(oo>pp)
  26.     {
  27.              System.out.println(oo+" is larger than "+pp);
  28.     }
  29.     else if(oo<pp)
  30.     {
  31.              System.out.println(pp+" is larger than "+oo);
  32.     }
  33.     else
  34.     {
  35.              System.out.println(oo+" equal "+pp);
  36.     }
  37.     }
  38. }
複製代碼

TOP

返回列表