-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathA_Chord.cpp
More file actions
51 lines (46 loc) · 1.51 KB
/
A_Chord.cpp
File metadata and controls
51 lines (46 loc) · 1.51 KB
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
#include <bits/stdc++.h>
using namespace std;
//----------------------------------------------------------------//
// definitions //
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define endl '\n'
//----------------------------------------------------------------//
// preDefined functions//
//----------------------------------------------------------------//
//data types//
//----------------------------------------------------------------//
// helper functions //
//----------------------------------------------------------------//
// solve function//
void solve() {
char S[ 4 ];
scanf( "%s", S );
if (S[ 0 ] == 'A' && S[ 1 ] == 'C' && S[ 2 ] == 'E')
printf( "Yes" );
else if (S[ 0 ] == 'B' && S[ 1 ] == 'D' && S[ 2 ] == 'F')
printf( "Yes" );
else if (S[ 0 ] == 'C' && S[ 1 ] == 'E' && S[ 2 ] == 'G')
printf( "Yes" );
else if (S[ 0 ] == 'D' && S[ 1 ] == 'F' && S[ 2 ] == 'A')
printf( "Yes" );
else if (S[ 0 ] == 'E' && S[ 1 ] == 'G' && S[ 2 ] == 'B')
printf( "Yes" );
else if (S[ 0 ] == 'F' && S[ 1 ] == 'A' && S[ 2 ] == 'C')
printf( "Yes" );
else if (S[ 0 ] == 'G' && S[ 1 ] == 'B' && S[ 2 ] == 'D')
printf( "Yes" );
else printf( "No" );
}
//----------------------------------------------------------------//
// main function//
int main() {
ios_base::sync_with_stdio( false );
cin.tie( NULL );
cout.tie( NULL );
long long test = 1;
// cin >> test;
while (test--) {
solve();
}
}