forked from encrypted-def/basic-algo-lecture
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2444.cpp
More file actions
30 lines (25 loc) · 808 Bytes
/
2444.cpp
File metadata and controls
30 lines (25 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Authored by : wogha95
// Co-authored by : -
// http://boj.kr/21a8fd913e464741a83d08770669ffdc
#include <bits/stdc++.h>
using namespace std;
int main(void) {
ios::sync_with_stdio(0);
cin.tie(0);
int N;
cin >> N;
for(int i = 1; i <= N - 1; i++) {
for(int j = 1; j <= N - i; j++) cout << ' ';
for(int j = 1; j <= 2 * i - 1; j++) cout << '*';
// '*'의 오른쪽 공백은 출력하지 말아야 통과합니다.
cout << "\n";
}
for(int j = 1; j <= 2 * N - 1; j++) cout << '*';
cout << "\n";
for(int i = N - 1; i >= 1; i--) {
for(int j = 1; j <= N - i; j++) cout << ' ';
for(int j = 1; j <= 2 * i - 1; j++) cout << '*';
// '*'의 오른쪽 공백은 출력하지 말아야 통과합니다.
cout << "\n";
}
}