标签:
package t4;
import java.util.Scanner;
public class t4 {
public static void main(String[] args)
{
String s=new String();
Scanner sc=new Scanner(System.in);
System.out.println("请输入情报");
s=sc.nextLine();
char []a=s.toCharArray();
int i;
for(i=0;i<s.length();i++)
{
a[i]=(char) (a[i]+3);
if((a[i]>‘Z‘&&a[i]<‘a‘)||a[i]>‘z‘)
a[i]=(char) (a[i]-26);
}
String s1=new String(a);
System.out.println("加密后的情报为"+s1);
}
}
标签:
原文地址:http://www.cnblogs.com/love-xi/p/5490348.html