-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathConstellation.cpp
54 lines (54 loc) · 1.46 KB
/
Constellation.cpp
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
42
43
44
45
46
47
48
49
50
51
52
53
54
//Code by Sahithi Siripuram
#include<bits/stdc++.h>
using namespace std;
#define FIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
int main()
{
FIO;
int n,i=0; cin>>n;
char a[3][n];
for(int i=0;i<3;i++)
for(int j=0;j<n;j++)
cin>>a[i][j];
while(i<n)
{
if(a[0][i]=='#'&&a[1][i]=='#'&&a[2][i]=='#')
{
cout<<"#", i++;
continue;
}
else if(a[0][i]=='.'&&a[1][i]=='.'&&a[2][i]=='.')
{
i++;
continue;
}
else if(a[0][i]=='.'&&a[0][i+1]=='*'&&a[0][i+2]=='.'&&a[1][i]=='*'&&a[1][i+1]=='*'&&a[1][i+2]=='*'&&a[2][i]=='*'&&a[2][i+1]=='.'&&a[2][i+2]=='*')
{
cout<<"A",i+=3;
continue;
}
else if(a[0][i]=='*'&&a[0][i+1]=='*'&&a[0][i+2]=='*'&&a[1][i]=='*'&&a[1][i+1]=='*'&&a[1][i+2]=='*'&&a[2][i]=='*'&&a[2][i+1]=='*'&&a[2][i+2]=='*')
{
cout<<"E",i+=3;
continue;
}
else if(a[0][i]=='*'&&a[0][i+1]=='*'&&a[0][i+2]=='*'&&a[1][i]=='.'&&a[1][i+1]=='*'&&a[1][i+2]=='.'&&a[2][i]=='*'&&a[2][i+1]=='*'&&a[2][i+2]=='*')
{
cout<<"I",i+=3;
continue;
}
else if(a[0][i]=='*'&&a[0][i+1]=='*'&&a[0][i+2]=='*'&&a[1][i]=='*'&&a[1][i+1]=='.'&&a[1][i+2]=='*'&&a[2][i]=='*'&&a[2][i+1]=='*'&&a[2][i+2]=='*')
{
cout<<"O",i+=3;
continue;
}
else if(a[0][i]=='*'&&a[0][i+1]=='.'&&a[0][i+2]=='*'&&a[1][i]=='*'&&a[1][i+1]=='.'&&a[1][i+2]=='*'&&a[2][i]=='*'&&a[2][i+1]=='*'&&a[2][i+2]=='*')
{
cout<<"U",i+=3;
continue;
}
else
i++;
}
return 0;
}