Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- #include <stdlib.h>
- int main()
- {
- int x;
- int tmp_x;
- int cifra;
- int zbir;
- int br_cifara = 0;
- while(scanf("%d", &x) == 1)
- {
- tmp_x = abs(x);
- br_cifara = (int)(log10(tmp_x) + 1);
- zbir = 0;
- while(tmp_x != 0)
- {
- cifra = tmp_x % 10;
- zbir = zbir + cifra;
- tmp_x = tmp_x / 10;
- }
- if((br_cifara % 2 == 0) || (zbir % 2 == 0))
- {
- printf("%d ", x);
- }
- }
- printf("\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement