Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5. int start = 0, end = 0, min_sweet = 0;
  6. int temp_num = 0;
  7. int i = 0;
  8. scanf("%d %d", &start, &end);
  9.  
  10. min_sweet = end + 1;
  11.  
  12. for (; start <= end; start++) {
  13. temp_num = start;
  14. while (temp_num > 0) {
  15. if (((temp_num % 10) % 2) != 0) {
  16. break;
  17. }
  18. temp_num /= 10;
  19. }
  20. if (temp_num == 0 && start <= min_sweet) {
  21. min_sweet = start;
  22. }
  23. }
  24. if (min_sweet == end+1) {
  25. printf("NSN");
  26. } else {
  27. printf("%d", min_sweet);
  28. }
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement