#include<stdio.h> void fun(long s,long *t) { int d; long s1=1; *t=0; while(s>0) { d=s%10; if(d%2!=0) { *t=d*s1+*t;s1*=10; } s/=10; } } void main() { long s,t; printf("\nPlease enter s:"); scanf("%ld",&s); fun(s,&t); printf("The result is :%ld\n",t); }
原文地址:http://blog.csdn.net/u013116579/article/details/38025413