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