Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Write a function, take out the even numbers in each bit of the long integer S in turn, and form a new number T, with the high position still at the high position and the low position still at the low
Write a function, take out the even numbers in each bit of the long integer S in turn, and form a new number T, with the high position still at the high position and the low position still at the low
Write a function, take out the even numbers in each bit of the long integer S in turn, and form a new number T, with the high position still at the high position and the low position still at the low position. # include & ltconio.h & gt

# include & ltstdio.h & gt

Void fun (long s, long *t)

{

int d;

long s 1 = 1;

* t = 0;

while(s & gt; 0)

{

d = s % 10;

if(d%2==0)

{

t = d * s 1+t;

s 1 * = 10;

}

s = s/ 10;

}

}

void main()

{

Long s, t;

Printf ("Please enter data s:");

scanf("%ld ",& amps);

Fun (s&; t);

Printf ("Result: %ld\n", t);

}