求流程图:C++ 用递归法将一个整数N转换成字符串,例如输入483,应输出字符串"483".
求流程图:C++ 用递归法将一个整数N转换成字符串,例如输入483,应输出字符串"483".
日期:2014-04-03 17:26:44 人气:1
#include
int main()
{
int i = 0 ,j, str[100],number;
scanf("%d",&number);
for(i = 0;number!=0;i++)
{
str[i] = number%10;
number = number/10;
}
j=i - 1;
for(i=j;i>=0;i--)
printf("%d ",str[i]);
return 0;
}