![在这里插入图片描述](https://img-blog.csdnimg.cn/20190531220556470.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2ExNDM5Nzc1NTIw,size_16,color_FFFFFF,t_70)
![在这里插入图片描述](https://img-blog.csdnimg.cn/20190531220619845.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2ExNDM5Nzc1NTIw,size_16,color_FFFFFF,t_70)
import java.util.ArrayList;
import java.util.Scanner;
public class zifuchuandezhankai {
static ArrayList<Integer> list = new ArrayList<Integer>();
public static void main(String[] args) {
char a, b;
int p1, p2, p3,temp=1;
String s,str="",s1="",s2="";;
Scanner sc = new Scanner(System.in);
p1 = sc.nextInt();
p2 = sc.nextInt();
p3 = sc.nextInt();
s = sc.next();
for (int i = 1; i < s.length() - 1; i+=temp) {
temp=1;
if (s.charAt(i) == '-' ) {
a = s.charAt(i - 1);
b = s.charAt(i + 1);
//|| (Character.isDigit(a) && Character.isLetter(b) )
if((a>=65 && b<65 ) || (a<65 && b>=65) || a>=b){
s=s.replaceFirst("-", str);
list.add(i);
continue;
}
if(Character.isLetter(a) && a>=97){
a-=32;
}
if(Character.isLetter(b) && b>=97){
b-=32;
}
if(a==b){
s=s.replaceFirst("-", "");
list.add(i);
continue;
}
for (int j = a+1; j <b; j++) {
//char c = Character.forDigit(j,10);
char c = (char)j;
str=str+c;
}
if(p1==1){
str=str.toLowerCase();
}
else if(p1==2){
str=str.toUpperCase();
}
else{
for (int j = 0; j < str.length(); j++) {
s1=s1+"*";
}
str=s1;
}
for (int j = 0; j < str.length(); j++) {
for (int j2 = 0; j2 < p2; j2++) {
s2=s2+str.charAt(j);
}
}
str=s2;
if(p3==2){
StringBuffer ss = new StringBuffer(str);
ss=ss.reverse();
str =ss.toString();
}
temp=str.length();
s=s.replaceFirst("-", str);
// list.add(str);
// System.out.println(str);
// list.add(str);
//System.out.println(str);
str="";
s1="";
s2="";
}
}
StringBuffer sss = new StringBuffer(s);
for (int j = list.size()-1; j >=0 ; j--) {
sss.insert(list.get(j), "-");
}
//
// sss=sss.substring(0, i)+sss.substring(i+1);
// sss.append(str, i, i);
System.out.println(sss);
}
}