标签:
package com;
import java.util.Scanner;
public class Secert {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("请输入一个大写的英文字符串:");
String aaa = input.nextLine();
System.out.println("该英文字符加密后为:");
for(int i =0;i<aaa.length();i++)
{
char ch = aaa.charAt(i);
if(ch==‘X‘)
{
System.out.print(‘A‘);
}
else if(ch==‘Y‘)
{
System.out.print(‘B‘);
}
else if(ch==‘Z‘)
{
System.out.print(‘C‘);
}
else
System.out.println((char)(ch+3));
}
}
}
标签:
原文地址:http://www.cnblogs.com/meng-1204/p/4907341.html