File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 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+ ```
You can’t perform that action at this time.
0 commit comments