题目:https://www.luogu.com.cn/problem/P1061
求问哪里有错
#include<iostream>
#include<cstring>
using namespace std;
int s,t,w;
string c;
void j(int x,bool o)
{
if(o==1)
{
c[x]++;
o=0;
if(c[x]==t-(w-1-x)+96)
{
c[x]=' ';
o=1;
}
}
if(j==0)
{
return;
}
j(x-1,o);
}
bool f()
{
if(c[0]==t-(w-1)+96)
{
return 0;
}
for(int i=1;i<w;i++)
{
if(c[i]==' ')
{
c[i]=c[i-1]+1;
}
}
return 1;
}
int main()
{
cin>>s>>t>>w;
cin>>c;
for(int i=0;i<5;i++)
{
j(w-1,1);
if(!f())
{
break;
}
cout<<c<<endl;
}
return 0;
}