#include <stdio.h>
#include <stdlib.h>
void convert(int n)
{
int i;
if((i = n/10) != 0)
{
convert(i);
}
putchar(n % 10 + '0');
}
int main(int argc, char *argv[])
{
int number;
printf("输入整数:");
scanf("%d", &number);
printf("输出是:");
if(number < 0)
{
putchar('-');
number = -number;
}
convert(number);
putchar('\n');
system("pause");
return 0;
}
|