atoi函数位于cstring
#include<iostream>
#include<cstring>
using namespace std;
string s1;
char s2[20];
int main()
{
cin>>s1;
cin>>s2;
int a=atoi(s1.c_str());
int b=atoi(s2);
cout<<"a="<<a<<endl;
cout<<"b="<<b<<endl;
return 0;
}