roblem Description
有一天, KIKI 收到一张奇怪的信, 信上要KIKI 计算出给定数各个位上数字为偶数的和.
eg. 5548
结果为12 , 等于 4 + 8
KIKI 很苦恼. 想请你帮忙解决这个问题.
Input
输入数据有多组,每组占一行,只有一个数字,保证数字在INT范围内.
Output
对于每组输入数据,输出一行,每两组数据之间有一个空行.
Sample Input
415326
3262
Sample Output
12
10
https://blog.csdn.net/lezg_bkbj/article/details/9325489
拿走不谢
#include<stdio.h>
#include<stdlib.h>
int main()
{
int n,m,k;
while(scanf("%d",&n) != EOF)
{
m = 0;
while(n)
{
k = n % 10;
if(!(k&1))
m += k;
n /= 10;
}
printf("%d\n",m);
}
return 0;
}