#include<iostream>
#include <cstdlib>
#include<string>
using namespace std;
int main()
{
string str = "1234";
string str1 = "6";
int n = atoi(str.c_str()); //#include <cstdlib>
int n2 = atoi(str1.c_str());
cout<<n+n2<<endl;
}
c++将一串字符串转数字
最新推荐文章于 2022-02-23 23:10:42 发布