四、改错题
1 #include <stdio.h> 2 #include <stdlib.h> 3 4 5 void fun(long s,long *t){ 6 int d; 7 long s1=1; 8 *t=0; 9 while(s>0){ 10 d=s%10; 11 if(d%2==0){ 12 *t=d*s1+*t; 13 s1*=10; 14 } 15 s/=10; 16 } 17 } 18 19 int main() 20 { 21 long s,t; 22 scanf("%ld",&s); 23 fun(s,&t); 24 printf("The result is:%ld\n",t); 25 return 0; 26 }
运行结果:
