File tree Expand file tree Collapse file tree 1 file changed +23
-4
lines changed Expand file tree Collapse file tree 1 file changed +23
-4
lines changed Original file line number Diff line number Diff line change 1
- // Authored by : BaaaaaaaaaaarkingDog
1
+ // Authored by : wogha95
2
2
// Co-authored by : -
3
- // http://boj.kr/****************
3
+ // http://boj.kr/21a8fd913e464741a83d08770669ffdc
4
4
#include < bits/stdc++.h>
5
5
using namespace std ;
6
6
7
- int main (void ){
7
+ int main (void ) {
8
8
ios::sync_with_stdio (0 );
9
9
cin.tie (0 );
10
-
10
+
11
+ int N;
12
+ cin >> N;
13
+
14
+ for (int i = 1 ; i <= N - 1 ; i++) {
15
+ for (int j = 1 ; j <= N - i; j++) cout << ' ' ;
16
+ for (int j = 1 ; j <= 2 * i - 1 ; j++) cout << ' *' ;
17
+ // '*'의 오른쪽 공백은 출력하지 말아야 통과합니다.
18
+ cout << " \n " ;
19
+ }
20
+
21
+ for (int j = 1 ; j <= 2 * N - 1 ; j++) cout << ' *' ;
22
+ cout << " \n " ;
23
+
24
+ for (int i = N - 1 ; i >= 1 ; i--) {
25
+ for (int j = 1 ; j <= N - i; j++) cout << ' ' ;
26
+ for (int j = 1 ; j <= 2 * i - 1 ; j++) cout << ' *' ;
27
+ // '*'의 오른쪽 공백은 출력하지 말아야 통과합니다.
28
+ cout << " \n " ;
29
+ }
11
30
}
You can’t perform that action at this time.
0 commit comments