[백준/Java] 6840 : Who is in the middle?

SEOP·2024년 6월 19일
0

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new BufferedReader(new InputStreamReader(System.in)));
        BufferedWriter bw = new BufferedWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

        List weightOfBowls = new ArrayList();

        for (int i = 0 ; i < 3 ; i++){
            weightOfBowls.add(Integer.parseInt(br.readLine()));
        }

        weightOfBowls.sort(Comparator.naturalOrder());

        bw.write(String.valueOf( weightOfBowls.get(1) ));

        bw.flush();
        bw.close();
    }
}
profile
응애 나 애기 개발자

0개의 댓글