Advertisement
Josif_tepe

Untitled

Nov 14th, 2023
705
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int rek(int x) {
  4.     if(x > 9 && x < 100) {
  5.         return 1;
  6.     }
  7.     if(x < 10) {
  8.         return 0;
  9.     }
  10.     return rek(x / 100);
  11. }
  12. int main () {
  13.  
  14.     int n;
  15.     scanf("%d", &n);
  16.    
  17.     printf("%d\n", rek(n));
  18.  
  19. return 0;
  20.  
  21. }
  22. // rek(1234) = rek(12) = 1
  23. // rek(12) = 1
  24.  
  25. // rek(12345) = rek(123) = 0
  26.  // rek(123) = rek(1) = 0
  27. // rek(1) = 0
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement