Advertisement
Josif_tepe

Untitled

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