Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int rek(int x) {
- if(x > 9 && x < 100) {
- return 1;
- }
- if(x < 10) {
- return 0;
- }
- return rek(x / 100);
- }
- int main () {
- int n;
- scanf("%d", &n);
- printf("%d\n", rek(n));
- return 0;
- }
- // rek(1234) = rek(12) = 1
- // rek(12) = 1
- // rek(12345) = rek(123) = 0
- // rek(123) = rek(1) = 0
- // rek(1) = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement