josiftepe

Untitled

Dec 28th, 2020
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.30 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int rekurzija(int broj)
  5. {
  6.    if (broj<10) return 0;
  7.    if (broj%10<=broj/10%10) return 1;
  8.    else return rekurzija(broj/10);
  9.  
  10. }
  11. int main()
  12. {
  13.     printf("Vnesi broj\n");
  14.     int n;
  15.     scanf("%d",&n);
  16.     printf("%d", rekurzija(n));
  17.     return 0;
  18. }
  19.  
Advertisement
Add Comment
Please, Sign In to add comment