1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
 * 두 개의 정수를 입력받아 대소관계를 비교하여 출력하는 프로그램을 구현하시오.
 * */
import java.io.*;
public class Exam_03 {
    public static void main(String[] ar) throws IOException{
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int first, second, temp;
        
        System.out.print("첫번째수 = ");
        first = Integer.parseInt(in.readLine());
        
        System.out.print("두번째수 = ");
        second = Integer.parseInt(in.readLine());
        
        if(second > first){
            temp = first;
            first = second;
            second = temp;
        }
                
        System.out.println();
        System.out.println(first + " >= " + second);
    }
}
 
cs


+ Recent posts