Advertisement
Josif_tepe

Untitled

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