69,369
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
char * Convert(int number)
{
int i=0;
int temp;
char a[20];
char * r=a;
while(number!=0)
{
temp=number%10;
a[i]=temp+48;
printf("%c\n",a[i]);
i++;
number=number/10;
}
a[i]='\0';
printf("%s\n",r);
printf("%d\n",r);
return r;
}
void main()
{
int temp;
char * r;
printf("The Number:");
scanf("%d",&temp);
r=Convert(temp);
printf("%d\n",r);
printf("The Result:%s",r);
getchar();
}