Fare丶梦


私信TA

用户名:126913199

访问量:31639

签 名:

等  级
排  名 145
经  验 4960
参赛次数 0
文章发表 50
年  龄 22
在职情况 学生
学  校
专  业

  自我简介:

解题思路:





注意事项:





参考代码:

import java.util.Scanner;


public class Main {

        public static void letter(String str){

                char[] array = str.toCharArray();

               for(int i=0;i<array.length;i++){

                        if(65<=array[i]&&array[i]<=90||97<=array[i]&&array[i]<=122){

                                if(array[i]=='Z')

                                        array[i] = 'A';

                                else if(array[i]=='z')

                                      array[i] = 'a';

                                else

                                        array[i]+=1;

                        }

                System.out.print(array[i]);

                }

        }

        public static void main(String[] arg){

                Scanner sc = new Scanner(System.in);

                String str = sc.nextLine();

                letter(str);

        }

}


 

0.0分

0 人评分

  评论区