552 : 반복제어문3 - 자가진단5
2020. 1. 31. 10:41ㆍLearn/Algorithm
기본별찍기 손풀기용
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
public class 정올역피라미드 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
for (int i = 0; i < a; i++) {
for (int j = 0; j < ((a*2-1)-i); j++) {
if(j < i)
System.out.print(" ");
else
System.out.print("*");
}
System.out.println();
}
}
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none;color:white">cs |
'Learn > Algorithm' 카테고리의 다른 글
2447 별찍기 -10 (0) | 2020.02.02 |
---|---|
11053 백준 가장 긴 증가하는 부분수열 (0) | 2020.02.02 |
1209. [S/W 문제해결 기본] 2일차 - Sum (0) | 2020.01.31 |
1223 계산기 2 (0) | 2020.01.30 |
1175 주사위던지기2 (0) | 2020.01.30 |