-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathB1032.java
More file actions
30 lines (24 loc) · 714 Bytes
/
B1032.java
File metadata and controls
30 lines (24 loc) · 714 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package Practice;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class B1032 { //¸í·É ÇÁ·ÒÇÁÆ®
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
int N = Integer.parseInt(br.readLine());
String[] files = new String[N];
for(int i = 0; i < N; i++) files[i] = br.readLine();
for(int i = 0; i < files[0].length(); i++) {
char c = files[0].charAt(i);
for(int j = 1; j < N; j++) {
if(c != files[j].charAt(i)) {
c = '?';
break;
}
}
sb.append(c);
}
System.out.println(sb);
}
}