8000 Create 2448_1.cpp · dkim-coder/basic-algo-lecture@5c7ef63 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5c7ef63

Browse files
authored
Create 2448_1.cpp
1 parent 2b7ccef commit 5c7ef63

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

0x0B/solutions/2448_1.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
// Authored by : paulcjy
2+
// Co-authored by : -
3+
// http://boj.kr/b510439ad07b43d2b6a689ff104c3783
14
#include <bits/stdc++.h>
25
using namespace std;
36

4-
void printStar(int n, int i, int j) {
7+
void print_star(int n, int i, int j) {
58
if (j <= 2*i)
69
if (n == 3 && !(i == 1 && j == 1)) cout << '*';
7-
else printStar(n/2, i%(n/2), j%n);
10+
else print_star(n/2, i%(n/2), j%n);
811
else cout << ' ';
912
}
1013

@@ -16,7 +19,7 @@ int main() {
1619
for (int i = 0; i < n; i++) {
1720
cout << string(n-i-1, ' ');
1821
for (int j = 0; j <= n+i; j++)
19-
printStar(n, i, j);
22+
print_star(n, i, j);
2023
cout << '\n';
2124
}
22-
}
25+
}

0 commit comments

Comments
 (0)
0