문제링크
https://www.acmicpc.net/problem/2742
나의코드
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.BufferedWriter;
import java.io.OutputStreamWriter;
public class Main{
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
int num = Integer.parseInt(br.readLine());
br.close();
while(num > 0){
bw.write(num + "\n");
num--;
}
bw.flush();
bw.close();
}
}
'Baekjoon Online Judge' 카테고리의 다른 글
[BOJ] 백준 1085번: 직사각형에서 탈출 (Java) (0) | 2023.03.29 |
---|---|
[BOJ] 백준 2920번: 음계 (Java) (0) | 2023.03.28 |
[BOJ] 백준 2741번: N 찍기 (Java) (0) | 2023.03.26 |
[BOJ] 백준 2577번: 숫자의 개수 (Java) (0) | 2023.03.25 |
[BOJ] 백준 2475번: 검증수 (Java) (0) | 2023.03.24 |
댓글