标签:
string int2str(int x) {
if (x) return num2str(x/10)+string(1,x%10+‘0‘);
else return "";
}
int str2int(string s) {
int x = 0;
for (char it : s)
x = x*10+it-‘0‘;
return x;
}
PS:谁还能更短(>.<)
标签:
原文地址:http://www.cnblogs.com/wubdut/p/5615343.html