帮帮我,为什么出错了
[Error] no matching function for call to 'stoi(__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
它写的第11行有问题
#include<bits/stdc++.h>
using namespace std;
int main()
{
string a;
cin >> a;
for(int i = 0;i<a.size();i++)
{
if(a[i] >= '1' && a[i] <= '9')
{
int num = stoi(a[i]);
string s = a.substr(0,i);
for(int j=1;j<=num;j++)
{
a.insert(i,1,s);
}
}
}
cout << a << endl;
return 0;
}