引入了头文件cstring却使用不了stoi函数
#include <iostream>
#include <bits/stdc++.h>
#include <cstring>
using namespace std;
int main()
{
string s;
while(cin>>s)
{
int sum=0;
for(int i=0;i<s.size();i++)
{
int start=0;
if(s[i]>='0'&&s[i]<='9')
{
start=i;
int len=0;
while(s[i]>='0'&&s[i]<='9'&&i<s.size())
{
i++;
len++;
}
string ss=s.substr(start,len);
//怎么把字符串转化为数字
sum+=stoi(ss);
}
}
}
return 0;
}
显示stoi was not declared in this scope;