✔ 最佳答案
See:
http://hk.knowledge.yahoo.com/question/question?qid=7008101401531
Reproduced here and adapted for your convenience:
2) Write a program that reads in one positive integer, separates the number into its individual digits and prints the digits from right to left, separated from one another by three spaces each.
For example, if your program reads 13579, it should print:
9 7 5 3 1
#include <stdio.h>
int main(int argc, char *argv[])
{
long n=-1;
int digit;
while(n>99999||n<0)
{
printf("enter a positive number (max. 5 digits)");
scanf("%ld",&n);
}
while(n>0)
{
printf("%d ",n%10);
n/=10;
}
printf("\n");
}