#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
using namespace std;
string my_tostring(int x)
{
vector<char> tmp;
while (x)
{
tmp.push_back(x % 10 + '0');
x /= 10;
}
reverse(tmp.begin(), tmp.end());
string s = "";
for (auto c : tmp)
s += c;
return s;
}
int main()
{
int n;
cin >> n;
string s = my_tostring(n);
cout << s;
system("pause");
return 0;
}
标签:tmp,10,string,int,tostring,手写,include
From: https://www.cnblogs.com/rdisheng/p/16772285.html