一些细节想得不全。
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int p1,p2,p3;
char a[110];
int lxy;
int main()
{
cin>>p1>>p2>>p3;
scanf("%s",a);
lxy=strlen(a);
for(int i=0;i<lxy;i++)
{
while(a[i]=='-')
{
cout<<a[i];i++;if(i>lxy) break;
}
if(a[i]!='-'&&a[i+1]!='-') cout<<a[i];
else
{
if(a[i]>='0'&&a[i]<='9')
{
if(a[i+2]>='0'&&a[i+2]<='9')
{
if(a[i+2]>a[i])
{
if(a[i+2]==a[i]+1) cout<<a[i],i+=1;
else
{
if(p1==3)
{
int x1=a[i]-'0',x2=a[i+2]-'0';
cout<<a[i];
for(int j=x1+1;j<x2;j++)
for(int l=1;l<=p2;l++)
{
cout<<'*';
}
i+=1;
}
else
{
if(p3==1)
{
int x1=a[i]-'0',x2=a[i+2]-'0';
cout<<a[i];
for(int j=x1+1;j<x2;j++)
{
char ch='0'+j;
for(int l=1;l<=p2;l++)
cout<<ch;
}
i+=1;
}
else
{
int x1=a[i]-'0',x2=a[i+2]-'0';
cout<<a[i];
for(int j=x2-1;j>x1;j--)
{
char ch='0'+j;
for(int l=1;l<=p2;l++)
cout<<ch;
}
i+=1;
}
}
}
}
else cout<<a[i]<<a[i+1],i+=1;
}
else cout<<a[i]<<a[i+1],i+=1;
}else
{
if(a[i+2]>='a'&&a[i+2]<='z')
{
if(a[i+2]-a[i]==1)
{
cout<<a[i];i+=1;
}
else
{
if(a[i+2]>a[i])
{
if(p1==1)
{
if(p3==1)
{
int x1=a[i]-'a',x2=a[i+2]-'a';
cout<<a[i];
for(int j=x1+1;j<x2;j++)
{
char ch='a'+j;
for(int l=1;l<=p2;l++)
cout<<ch;
}
i+=1;
}
else
{
int x1=a[i]-'a',x2=a[i+2]-'a';
cout<<a[i];
for(int j=x2-1;j>x1;j--)
{
char ch='a'+j;
for(int l=1;l<=p2;l++)
{
cout<<ch;
}
}
i+=1;
}
}
if(p1==2)
{
if(p3==1)
{
int x1=a[i]-'a',x2=a[i+2]-'a';
cout<<a[i];
for(int j=x1+1;j<x2;j++)
{
char ch='A'+j;
for(int l=1;l<=p2;l++)
cout<<ch;
}
i+=1;
}
else
{
int x1=a[i]-'a',x2=a[i+2]-'a';
cout<<a[i];
for(int j=x2-1;j>x1;j--)
{
char ch='A'+j;
for(int l=1;l<=p2;l++)
{
cout<<ch;
}
}
i+=1;
}
}
if(p1==3)
{
cout<<a[i];
int x=a[i+2]-a[i]-1;
for(int j=1;j<=x*p2;j++) cout<<'*';
i+=1;
}
}
else cout<<a[i]<<a[i+1],i+=1;
}
}
else cout<<a[i]<<a[i+1],i+=1;
}
}
}
return 0;
}