Advertisement
Josif_tepe

Untitled

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