#include <bits/stdc++.h>
using namespace std;
int p1,p2,p3;
int length=0;
string dispose_str(char begin,char end){
int len=end-begin-1;
string ans,temp;
if (len>25||len<0||begin=='-'||end=='-'){
return "-";
}
char letter=begin+1;
if (p1==2)
letter=toupper(letter);
else if (p1==3)
letter='*';
while (len>0){
for (int i = 0; i <p2 ; ++i) {
temp+=letter;
}
if (p1<3)
letter+=1;
len--;
}
if (p3==2)
for (int i = temp.length()-1; i >=0 ; --i) {
ans+=temp[i];
}
else
ans=temp;
return ans;
}
int main() {
scanf("%d%d%d",&p1,&p2,&p3);
string str;
cin>>str;
for (int i = 1; i < str.length()-1; ++i) {
if (str[i]=='-'){
string temp;
temp=dispose_str(str[i-1],str[i+1]);
str.replace(i,1,temp);
i+=temp.length();
}
}
cout<<str<<endl;
return 0;
}
P1098 字符串的展开
最新推荐文章于 2024-01-21 23:23:20 发布