forked from encrypted-def/basic-algo-lecture
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2446.cpp
More file actions
28 lines (23 loc) · 615 Bytes
/
2446.cpp
File metadata and controls
28 lines (23 loc) · 615 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
// Authored by : wogha95
// Co-authored by : -
// http://boj.kr/7026df35c02346969ab865fd2c15ad16
#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 = 0; i < N - 1; i++) {
for(int j = 0; j < i; j++) cout << ' ';
for(int j = 0; j < 2 * (N - i) - 1; j++) cout << '*';
cout << "\n";
}
for(int j = 0; j < N - 1; j++) cout << ' ';
cout << "*\n";
for(int i = 1; i <= N - 1; i++) {
for(int j = 1; j <= N - i - 1; j++) cout << ' ';
for(int j = 1; j <= 2 * i + 1; j++) cout << '*';
cout << "\n";
}
}