字符串转数字
string a = "1234";
int b = atoi(a.c_str());
double c = atof(a.c_str());
long d = atol(a.c_str());
long long e = atoll(a.c_str());
//或者
//stringstream最好只用1次,放在循环体内
stringstream temp;
int a;
string b = "45454";
temp << b;
temp >> a;
数字转字符串
//stringstream最好只用1次,放在循环体内
stringstream temp;
int a = 555;
string b;
temp << a;
temp >> b;