Advertisement
josiftepe

Untitled

Nov 14th, 2021
696
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.64 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int funkcija(int a){
  4.     int posledna,pretposledna;
  5.     while(a>9){
  6.     posledna=a%10;
  7.     pretposledna=(a/10)%10;
  8.         a=a/10;
  9.         if((pretposledna%posledna)!=0)
  10.             return 0;
  11.            
  12.     }
  13.     return 1;
  14. }
  15. int funkcija2(int b){
  16.     int posledna2,pretposledna2;
  17.     while(b>9){
  18.         posledna2=b%10;
  19.         b=b/10;
  20.         pretposledna2=b%10;
  21.        if((pretposledna2<posledna2)!=0)
  22.            return 0;
  23.     }
  24.     return 1;
  25. }
  26.  
  27. int main(){
  28.     int broj;
  29.     scanf("%d", &broj);
  30.    printf("%d", funkcija(broj));
  31.     printf("%d", funkcija2(broj));
  32.     return 0;
  33. }
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement