Advertisement
Guest User

Untitled

a guest
Jan 19th, 2020
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int c;
  5.  
  6.  
  7. void A();
  8.  
  9. void B();
  10.  
  11. void ERROR(); /* функция обработки ошибок */
  12.  
  13. void S() {A(); B();
  14.  
  15. if (c != '^') ERROR();
  16.  
  17. }
  18.  
  19. void A() {if (c=='a') c = getchar();
  20.  
  21. else if (c == 'c') {c = getchar(); A();}
  22.  
  23. else ERROR();
  24.  
  25. }
  26.  
  27. void B() {if (c == 'b') {c = getchar(); A();}
  28.  
  29. else ERROR();
  30.  
  31. }
  32.  
  33. void ERROR() {printf("ERROR !!!"); exit(1);}
  34.  
  35. void main() {
  36. c = getchar();
  37. S();
  38. printf("SUCCESS !!!"); exit(0);
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement