Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Enter a positive number S of a long integer, take out the odd numbers in S in turn to form a new number and put it in T (high or high, low or low).
Enter a positive number S of a long integer, take out the odd numbers in S in turn to form a new number and put it in T (high or high, low or low).
//# contains? " stdafx.h"//If? That? vc++6.0,? With what? This? Line.

# Contains? " stdio.h "

int? Major (Invalid) {

Dragon? s,t,n,x;

Printf ("input? Answer? Numbers ... \ ns = ");

scanf("%d ",& amps); //enter a long integer s.

t=s,n = 1;

while(t/= 10)? n * = 10; //Determine how many digits S has. If it is 3 digits, n= 100, and so on.

While(s){// Check each bit from high to low.

if((x = s/n)& amp; 1)/If it is odd.

(t * = 10)+= x; //Multiply t by the odd number 10+ to form a new number consisting of odd numbers.

s%=n,n/= 10; //Adjust the control variables to make correct cycle judgment.

}

printf("The? New? Number? Is it? %d\n ",t); //output

Return? 0;

}