문제 출처 https://www.acmicpc.net/problem/2439
내가 작성한 코드
import java.io.IOException;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
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 n = Integer.parseInt(br.readLine()); //int형 변환
for(int i=1; i<=n; i++) {
String s = "*";
String m =" "; //공백 문자열
bw.write(m.repeat(n-i)+s.repeat(i)+"\n");
}
bw.flush();
bw.close();
}
}