[Plain] Description
Input a positive and long integer (no more than 10 digits) from the keyboard, split and output from the high position one by one.
Input
Positive integer n, excluding leading zero.
Output
Split an integer sequence. Each integer is separated by an empty space.
Note that there is no space behind the last number!
Sample Input
654321
Sample Output
6 5 4 3 2 1
Description
Input a positive and long integer (no more than 10 digits) from the keyboard, split and output from the high position one by one.
Input
Positive integer n, excluding leading zero.
Output
Split an integer sequence. Each integer is separated by an empty space.
Note that there is no space behind the last number!
Sample Input
654321
Sample Output
6 5 4 3 2 1
[Plain] # include <stdio. h>
Int main ()
{
Int I;
Int num;
Int length = 0;
Int array [10];
Scanf ("% d", & num );
While (num)
{
Array [length ++] = num % 10;
Num/= 10;
}
For (I = length-1; I> = 0; I --)
{
Printf ("% d", array [I]);
If (I> 0)
{
Printf ("");
}
}
Return 0;
}
# Include <stdio. h>
Int main ()
{
Int I;
Int num;
Int length = 0;
Int array [10];
Scanf ("% d", & num );
While (num)
{
Array [length ++] = num % 10;
Num/= 10;
}
For (I = length-1; I> = 0; I --)
{
Printf ("% d", array [I]);
If (I> 0)
{
Printf ("");
}
}
Return 0;
}