Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int start = 0, end = 0, min_sweet = 0;
- int temp_num = 0;
- int i = 0;
- scanf("%d %d", &start, &end);
- min_sweet = end + 1;
- for (; start <= end; start++) {
- temp_num = start;
- while (temp_num > 0) {
- if (((temp_num % 10) % 2) != 0) {
- break;
- }
- temp_num /= 10;
- }
- if (temp_num == 0 && start <= min_sweet) {
- min_sweet = start;
- }
- }
- if (min_sweet == end+1) {
- printf("NSN");
- } else {
- printf("%d", min_sweet);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement