Home > Back-end >  Input output 4321 C 1234 6.0
Input output 4321 C 1234 6.0

Time:09-28

Title description
Input from the keyboard a four integer, reverse the output of the four figures, such as input: 1234, output: 4321

Enter
1234

O
4321

The sample input
2015
Sample output
5102
Tip
To pay attention to the input and output and the topic request, do not add any modifiers, such as the input x: the scanf (" % d ", & amp; X); Output x: printf (" % d ", x);

CodePudding user response:

Int x, y, I;
The scanf (" % d ", & amp; X);
Y=0;
for(i=0; i<4. I++)
{
Y=y * 10 + x % 10;
X/=10;
}
Y=x;
Printf (" % d ", x);

CodePudding user response:

Nt x, y, I;
The scanf (" % d ", & amp; X);
Y=0;
for(i=0; i<4. I++)
{
Y=y * 10 + x % 10;
X/=10;
}
X=y;//here write backwards, ha ha
Printf (" % d ", x);

CodePudding user response:

BCB is it?

There is a most simple function: ReverseString

Reverses the string directly...
  • Related