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
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
 * 세 개의 정수를 입력받아 큰 순서대로 나열하여 출력하는 프로그램을 구현하시오.
 * */
import java.io.*;
public class Exam_04 {
    public static void main(String[] ar) throws IOException{
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int first, second, third, temp;
        
        System.out.print("첫번째수 = ");
        first = Integer.parseInt(in.readLine());
        
        System.out.print("두번째수 = ");
        second = Integer.parseInt(in.readLine());
        
        System.out.print("세번째수 = ");
        third = Integer.parseInt(in.readLine());
        
        if(second > first && second > third){
            temp = first;
            first = second;
            second = temp;
        }else if(third > first && third > second){
            temp = first;
            first = third;
            third = temp;
        }
        
        if(third > second){
            temp = second;
            second = third;
            third = temp;
        }
        
        System.out.println();
        System.out.println(first + " >= " + second + " >= " + third);
    }
}
 
cs


+ Recent posts