本文共 408 字,大约阅读时间需要 1 分钟。
#include#include #include void main(void){ int num = 12345,i = 0, j = 0; char temp[7],str[7]; while(num) { temp[i] = num%10 + '0'; num = num/10; i++; } temp[i] = 0;//注意勿忘 i = i - 1; printf("%s\n",temp); while(i>=0) { str[j] = temp[i]; j++; i--; } //str[j] = 0; str[j] = 0;printf("%s\n",str);}
转载地址:http://eokhj.baihongyu.com/