-
Notifications
You must be signed in to change notification settings - Fork 0
/
2448.cpp
45 lines (37 loc) · 828 Bytes
/
2448.cpp
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include<iostream>
#include<vector>
using namespace std;
char board[3073][6145];
void drawStar(int y, int x, int a){
if(a == 3){
board[y][x] = '*';
board[y+1][x-1] = '*';
board[y+1][x+1] = '*';
for(int i = x-2; i < x+3; i++){
board[y+2][i] = '*';
}
return;
}
drawStar(y, x, a/2);
drawStar(y+a/2, x - a/2, a/2);
drawStar(y+a/2, x + a/2, a/2);
}
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
for(int i = 0; i < 3073; i++){
for(int j = 0; j < 6145; j++){
board[i][j] = ' ';
}
}
drawStar(0, n-1, n);
for(int i = 0; i < n; i++){
for(int j = 0; j < 2*n-1; j++){
cout << board[i][j];
}
cout << '\n';
}
}