forked from encrypted-def/basic-algo-lecture
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2445.cpp
More file actions
30 lines (25 loc) · 744 Bytes
/
2445.cpp
File metadata and controls
30 lines (25 loc) · 744 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/aee90111832742cb969736538c8f2d62
#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 <= i; j++) cout << '*';
for(int j = 1; j <= 2 * (N - i); j++) cout << ' ';
for(int j = 1; j <= i; j++) cout << '*';
cout << "\n";
}
for(int j = 1; j <= 2 * N; j++) cout << '*';
cout << "\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; j++) cout << ' ';
for(int j = 1; j <= N - i; j++) cout << '*';
cout << "\n";
}
}