私信TA

用户名:Praguetramp

访问量:29452

签 名:

等  级
排  名 19
经  验 19953
参赛次数 0
文章发表 130
年  龄 0
在职情况 待业
学  校
专  业

  自我简介:

aura

解题思路:    循环判断,字符串连接

注意事项:

参考代码:

import java.util.Scanner;
public class Main {	
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String s  =in.nextLine(),res="";
		for(int i=0;i<s.length();i++) {
			char e =s.charAt(i);
			if(e>='A'&&e<='Y'||e>='a'&&e<='y')
				res+=(char)(e+1);
			else if(e=='z')
				res+="A";
			else if(e=='Z')
				res+='a';
			else
				res+=e;
		}
		System.out.println(res);
		in.close();
	}
}


 

0.0分

1 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答

代码解释器

  评论区