Advertisement
damch

blag br

Nov 19th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3.  
  4. int main ()
  5. {
  6.  
  7. int n,m;
  8. int broj;
  9. int i,j;
  10. int z=0;
  11. int delac=1;
  12. int brcifri=0;
  13. scanf("%d %d",&n,&m);
  14.  
  15. int cuvajn=m;
  16.  
  17. int min=m+1;
  18. for (i=m;i>=n;i--)
  19. {
  20.  
  21. delac=1;
  22. z=0;
  23. while(cuvajn>0)
  24. {
  25. brcifri++;
  26. cuvajn/=10;
  27. }
  28.  
  29. for(j=1;j<=brcifri;j++)
  30. {
  31.  
  32. if((i/delac%10)%2==0)
  33. z++;
  34. delac*=10;
  35. if(z==brcifri)
  36. {
  37. if(i<=min)
  38. min=i;
  39. }
  40. }
  41.  
  42.  
  43. }
  44.  
  45. if(min==m+1)
  46. {
  47. printf("NE");
  48. }
  49. else
  50. printf("%d",min);
  51.  
  52.  
  53. return 0;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement