Skip to content

Commit bd93bea

Browse files
authored
[20250816] BOJ / G5 / 별 찍기 - 10 / 김수연
1 parent b7d331a commit bd93bea

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
```java
2+
import java.io.*;
3+
import java.util.*;
4+
5+
public class boj2447 {
6+
static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
7+
static StringTokenizer st;
8+
static void nextLine() throws Exception {st = new StringTokenizer(br.readLine());}
9+
static int nextInt() {return Integer.parseInt(st.nextToken());}
10+
static StringBuilder sb = new StringBuilder();
11+
12+
public static void main(String[] args) throws Exception {
13+
nextLine();
14+
int N = nextInt();
15+
for (int i = 0; i < N; i++) {
16+
for (int j = 0; j < N; j++) {
17+
star(i, j, N);
18+
}
19+
sb.append('\n');
20+
}
21+
System.out.println(sb);
22+
}
23+
24+
static void star(int i, int j, int n){
25+
if((i / n) % 3 == 1 && (j / n) % 3 == 1){
26+
sb.append(' ');
27+
}
28+
else{
29+
if(n == 1) sb.append('*');
30+
else star(i, j, n / 3);
31+
}
32+
}
33+
}
34+
```

0 commit comments

Comments
 (0)