Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - I would like to ask how to write a program that takes the odd bits of the long integer variable S from the low order and puts them into T in turn.
I would like to ask how to write a program that takes the odd bits of the long integer variable S from the low order and puts them into T in turn.
# include & ltiostream & gt

Use namespace std

int main()

{

int s,t,I,j,map[20];

CIN & gt; & gts;

Me? = t = 0;

While(s)// Put every word in s into the array.

{

map[i++]= s % 10;

s/= 10;

}

I-;

for(j = I; j & gt= 0; J -= 2)// Put forward odd terms.

{

t * = 10;

t+= map[j];

}

cout & lt& ltt & lt& ltendl

Returns 0;

}