We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a7cbbd3 + 36da0a1 commit 46aaf50Copy full SHA for 46aaf50
JHLEE325/202509/07 BOJ G5 A와 B.md
@@ -0,0 +1,33 @@
1
+```java
2
+import java.io.*;
3
+import java.util.*;
4
+
5
+public class Main {
6
+ public static void main(String[] args) throws IOException {
7
+ BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
8
+ StringTokenizer st;
9
+ String s = br.readLine();
10
+ String t = br.readLine();
11
12
+ StringBuilder sb = new StringBuilder();
13
+ sb.append(t);
14
15
+ while (s.length() < sb.length()) {
16
+ char lastChar = sb.charAt(sb.length() - 1);
17
18
+ sb.deleteCharAt(sb.length() - 1);
19
20
+ if (lastChar == 'B') {
21
+ sb.reverse();
22
+ }
23
24
25
+ if (s.equals(sb.toString())) {
26
+ System.out.println(1);
27
+ } else {
28
+ System.out.println(0);
29
30
31
+}
32
33
+```
0 commit comments