#include<iostream> #include<cstdio> 整数转换为字符串: #include<cstring> #include<algorithm> #include<stdlib.h> using namespace std; int main() { int num = 100; char str[25]; sprintf(str,"%d",100); printf("%c %c %c",str[0],str[1],str[2]); return 0; } 字符串
#include<iostream> #include<cstdio> 整数转换为字符串: #include<cstring> #include<algorithm> #include<stdlib.h> using namespace std; int main() { int num = 100; char str[25]; sprintf(str,"%d",100); printf("%c %c %c",str[0],str[1],str[2]); return 0; } 字符串
转载于:https://www.cnblogs.com/Leozi/p/10835685.html