#include <iostream> #include <string> #include <sstream> using namespace std; string int2str(int &i) { string s; stringstream ss(s); ss << i; return ss.str(); } int main(int argc, const char * argv[]) { int a = 123; string str_a = int2str(a); cout<<str_a<<endl; return 0; }
时间: 2024-10-12 04:00:17