-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1032.cpp
More file actions
41 lines (37 loc) · 684 Bytes
/
1032.cpp
File metadata and controls
41 lines (37 loc) · 684 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
31
32
33
34
35
36
37
38
39
40
41
#include <iostream>
#include <string>
using namespace std;
int main()
{
int N;
string strings[51];
cin >> N;
for (int i = 0; i < N; i++)
{
cin >> strings[i];
}
string pivot = strings[0];
string answer = "";
for (int i = 0; i < pivot.length(); i++)
{
bool chk = true;
for (int j = 1; j < N; j++)
{
if (pivot[i] != strings[j][i])
{
chk = false;
break;
}
}
if (chk)
{
answer += pivot[i];
}
else
{
answer += '?';
}
}
cout << answer << endl;
return 0;
}