Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int c;
- void A();
- void B();
- void ERROR(); /* функция обработки ошибок */
- void S() {A(); B();
- if (c != '^') ERROR();
- }
- void A() {if (c=='a') c = getchar();
- else if (c == 'c') {c = getchar(); A();}
- else ERROR();
- }
- void B() {if (c == 'b') {c = getchar(); A();}
- else ERROR();
- }
- void ERROR() {printf("ERROR !!!"); exit(1);}
- void main() {
- c = getchar();
- S();
- printf("SUCCESS !!!"); exit(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement