-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprac6.cpp
60 lines (50 loc) · 793 Bytes
/
prac6.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
55
56
57
58
59
60
#include <iostream>
using namespace std;
char c;
int A();
int C();
int E() {
c = getchar();
if(c != 'a' && c != '\n')
return 1;
return c == 'a' ? A() : 0;
}
int A() {
c = getchar();
if(c != 'a')
return 1;
return E();
}
int B() {
c = getchar();
if(c != 'a')
return 1;
return A();
}
int F() {
c = getchar();
if(c != 'a' && c != '\n')
return 1;
return c == 'a' ? C() : 0;
}
int C() {
c = getchar();
if(c != 'a' && c != 'b')
return 1;
return c == 'a' ? F() : B();
}
int D() {
c = getchar();
if(c != 'a')
return 1;
return C();
}
int H() {
c = getchar();
if(c != 'b')
return 1;
return D();
}
int main() {
cout << (!H() ? "yes" : "no") << endl;
}