#include<stdio.h>
long fun(long int x)
{
long b = 0;
while(x>0)
{
if( (x%10)%2 )
b = b*10 + x%10;
x/=10;
}
return b;
}
int main()
{
long a,b;
while(1)
{
printf("Please input a long int num:");
scanf("%ld",&a);
b=fun(a);
printf("b=%ld\n",b);
}
}
#include<stdio.h>
long fun(long int x)
{
long b = 0;
while(x>0)
{
if( (x%10)%2 )
b = b*10 + x%10;
x/=10;
}
return b;
}
int main()
{
long a,b;
while(1)
{
printf("Please input a long int num:");
scanf("%ld",&a);
b=fun(a);
printf("b=%ld\n",b);
}
}