202 比較大小

import java.util.*;
class JPA202 {
    static Scanner keyboard = new Scanner(System.in);
    public static void main(String[] args) {
        test();
        test();
    }

    public static void test() {
    int x,y;
        System.out.println("Input:");
        x=keyboard.nextInt();
        y=keyboard.nextInt();
        if(x>y){
        System.out.println(x+" is larger than "+y);
        }
        else{
        System.out.println(y+" is larger than "+x);
        }
    }
}

沒有留言:

張貼留言