8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5b2480c + 5c7ef63 commit 6f64ef1Copy full SHA for 6f64ef1
0x0B/solutions/2448_1.cpp
@@ -0,0 +1,25 @@
1
+// Authored by : paulcjy
2
+// Co-authored by : -
3
+// http://boj.kr/b510439ad07b43d2b6a689ff104c3783
4
+#include <bits/stdc++.h>
< 8000 /code>
5
+using namespace std;
6
+
7
+void print_star(int n, int i, int j) {
8
+ if (j <= 2*i)
9
+ if (n == 3 && !(i == 1 && j == 1)) cout << '*';
10
+ else print_star(n/2, i%(n/2), j%n);
11
+ else cout << ' ';
12
+}
13
14
+int main() {
15
+ ios::sync_with_stdio(0);
16
+ cin.tie(0);
17
+ int n;
18
+ cin >> n;
19
+ for (int i = 0; i < n; i++) {
20
+ cout << string(n-i-1, ' ');
21
+ for (int j = 0; j <= n+i; j++)
22
+ print_star(n, i, j);
23
+ cout << '\n';
24
+ }
25
0 commit comments