Skip to content

Commit

Permalink
CT_368
Browse files Browse the repository at this point in the history
  • Loading branch information
Jade-Good committed Jan 22, 2025
1 parent 3df7153 commit 3cd98c8
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions BOJ/Java/src/B2/Boj_10996_별찍기21.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package B2;

import java.io.*;

public class Boj_10996_별찍기21 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
StringBuilder sb = new StringBuilder();

int n = Integer.parseInt(br.readLine());

for (int i = 0; i < n; i++) {

sb.append('*');

for (int j = 0; j < (n - 1) / 2; j++) {
sb.append(' ').append('*');
}

sb.append('\n');

for (int j = 0; j < n / 2; j++) {
sb.append(' ').append('*');
}

sb.append('\n');
}

bw.write(sb.toString());
bw.flush();
}
}

0 comments on commit 3cd98c8

Please sign in to comment.