Advertisement
Dekozz

Blag Broj

Oct 24th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.48 KB | None | 0 0
  1. #include <stdio.h>
  2. int main(){
  3. int a,b,i,broj,mozhe=0,cifra;
  4.     scanf("%d%d",&a,&b);
  5.  
  6.     for(i=a;i<=b;i++){
  7.     broj = i;
  8.     mozhe=0;
  9.         while(broj>0){
  10.             cifra=broj%10;
  11.             if(cifra==1 || cifra==3 || cifra==5 || cifra==7 || cifra==9){
  12.             mozhe = 0;
  13.             break;
  14.             }
  15.             mozhe=1;
  16.             broj=broj/10;
  17.         }
  18.         if(mozhe==1){
  19.         printf("%d",i);
  20.         return 0;
  21.         }
  22.     }
  23.     printf("NE");
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement