Skip to content

Commit

Permalink
CT_339
Browse files Browse the repository at this point in the history
  • Loading branch information
Jade-Good committed Dec 19, 2024
1 parent 7494201 commit 489f559
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions BOJ/Java/src/B3/Boj_32778_가희와부역명.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package B3;

import java.io.*;

public class Boj_32778_가희와부역명 {
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();

char[] chars = br.readLine().toCharArray();
boolean flag = true;

for (char c : chars) {
if (c == '(' || c == ')') {
sb.append('\n');
flag = false;
} else {
sb.append(c);
}
}

if (flag) sb.append('\n').append('-');

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

0 comments on commit 489f559

Please sign in to comment.