点击打开链接
#include<stdio.h> int main() { int i,sum,n; int flag=0; while(scanf("%d",&n)!=EOF) { sum=0; while(n>0) { i=n%10; if(i%2==0)sum+=i; n/=10; } if(flag==1)printf("\n"); printf("%d\n",sum); flag=1; } return 0; }