https://www.acmicpc.net/problem/2439
정답
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
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());
for(int i =1 ;i<=n;i++){
for(int j =1; j<=n-i;j++){
System.out.print(" ");
}
for(int k=1;k<=i;k++){
System.out.print("*");
}
System.out.println();
}
}
}
'JAVA > 백준' 카테고리의 다른 글
[Java11] 10951번 : A+B-4 (0) | 2024.09.11 |
---|---|
[Java11] A+B -5 (0) | 2024.09.11 |
[Java11] 2438번 : 별 찍기 - 1 (0) | 2024.09.11 |
[Java11] 11022번 : A+B -8 (0) | 2024.09.11 |
[Java11] 11021번 : A+B -7 (0) | 2024.09.11 |