Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

21.02.10 - [BOJ] 2750. 수 정렬하기 #12

Closed
suhyunsim opened this issue Feb 14, 2021 · 0 comments
Closed

21.02.10 - [BOJ] 2750. 수 정렬하기 #12

suhyunsim opened this issue Feb 14, 2021 · 0 comments
Assignees
Labels
브론즈 BOJ - 브론즈 성공 맞은 문제 정렬 정렬하기

Comments

@suhyunsim
Copy link
Owner

suhyunsim commented Feb 14, 2021

문제

핵심 아이디어

  • 입력받은 숫자들을 정렬하는 문제
  • Collection의 sort 기능을 이용해서 정렬 후 출력했다.
  • BufferedReader를 사용해서 구현했다.

어려운 점, 실수

풀이

package main.java.com.poogle.BOJ.Q2750;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list.add(Integer.parseInt(br.readLine()));
        }
        Collections.sort(list);
        for (int i : list) System.out.println(i);
    }
}
@suhyunsim suhyunsim self-assigned this Feb 14, 2021
@suhyunsim suhyunsim added the 실버 BOJ - 실버 label Feb 14, 2021
@suhyunsim suhyunsim changed the title 21.02.11 - [BOJ] 2750. 수 정렬하기 21.02.10 - [BOJ] 2750. 수 정렬하기 Feb 14, 2021
@suhyunsim suhyunsim added 구현 성공 맞은 문제 정렬 정렬하기 브론즈 BOJ - 브론즈 and removed 실버 BOJ - 실버 labels Feb 14, 2021
@suhyunsim suhyunsim added this to the 2월 2주 차 milestone Feb 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
브론즈 BOJ - 브론즈 성공 맞은 문제 정렬 정렬하기
Projects
None yet
Development

No branches or pull requests

1 participant