File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ * Author: Minho Kim (ISKU)
3
+ * Date: October 20, 2019
4
+ * E-mail: minho.kim093@gmail.com
5
+ *
6
+ * https://github.com/ISKU/Algorithm
7
+ * https://www.acmicpc.net/problem/17502
8
+ */
9
+
10
+ import java .io .*;
11
+
12
+ public class Main {
13
+ public static void main (String [] args ) throws Exception {
14
+ BufferedReader br = new BufferedReader (new InputStreamReader (System .in ));
15
+ int N = Integer .parseInt (br .readLine ());
16
+
17
+ char [] word = br .readLine ().toCharArray ();
18
+ for (int i = 0 , j = N - 1 ; i <= j ; i ++, j --) {
19
+ if (word [i ] == '?' && word [j ] == '?' ) {
20
+ word [i ] = 'a' ;
21
+ word [j ] = 'a' ;
22
+ continue ;
23
+ }
24
+ if (word [i ] == '?' )
25
+ word [i ] = word [j ];
26
+ if (word [j ] == '?' )
27
+ word [j ] = word [i ];
28
+ }
29
+
30
+ System .out .println (word );
31
+ }
32
+ }
You can’t perform that action at this time.
0 commit comments