File tree 4 files changed +43
-0
lines changed
4 files changed +43
-0
lines changed Original file line number Diff line number Diff line change 45
45
| 06 | | [ Baekjoon-9250 문자열 집합 판별] ( ./src/String/P9250 ) | Aho-Corasick |
46
46
| 07 | | [ Baekjoon-10256 돌연변이] ( ./src/String/P10256 ) | Aho-Corasick |
47
47
| 08 | | [ Baekjoon-15740 A+B - 9] ( ./src/String/P15740 ) | |
48
+ | 09 | | [ Baekjoon-9093 단어 뒤집기] ( ./src/String/P9093 ) | |
48
49
49
50
## Brute Force
50
51
Original file line number Diff line number Diff line change
1
+ package String .P9093 ;
2
+
3
+ import java .io .*;
4
+ import java .util .*;
5
+
6
+ public class Main {
7
+
8
+ static int T ;
9
+ static StringBuilder sb = new StringBuilder ();
10
+ static StringBuffer buf = new StringBuffer ();
11
+
12
+ public static void main (String [] args ) throws Exception {
13
+ System .setIn (new FileInputStream ("src/String/P9093/input.txt" ));
14
+ BufferedReader br = new BufferedReader (new InputStreamReader (System .in ));
15
+
16
+ T = Integer .parseInt (br .readLine ());
17
+ while (T -- > 0 ) {
18
+ StringTokenizer st = new StringTokenizer (br .readLine ());
19
+ while (st .hasMoreTokens ()) {
20
+ buf .setLength (0 );
21
+ sb .append (buf .append (st .nextToken ()).reverse ()).append (" " );
22
+ }
23
+ sb .append ("\n " );
24
+ }
25
+ System .out .println (sb .toString ());
26
+ }
27
+ }
Original file line number Diff line number Diff line change
1
+ ## [ baekjoon-9093] 단어 뒤집기
2
+
3
+ ![ image] ( https://user-images.githubusercontent.com/22045163/106906619-b5c3ad80-6740-11eb-8aa2-7dc86e9c8e96.png )
4
+
5
+ ### 문자열 뒤집는 방법 - Java
6
+
7
+ ``` java
8
+ StringBuffer buffer = new StringBuffer ();
9
+ String s = " Hello" ;
10
+ buffer. append(s). reverse();
11
+ System . out. println(buffer. toString()); // olleH
12
+ ```
Original file line number Diff line number Diff line change
1
+ 2
2
+ I am happy today
3
+ We want to win the first prize
You can’t perform that action at this time.
0 commit comments