程序源代码:
//邵文政 20142894 2015 10 22 public class Keys { public static void main(String[] args) { String qkeys="qweqwewqefdf DSDSFdggr"; int lengths; char c ; lengths=qkeys.length(); System.out.println("解密后的结果是:"); for(int i=0;i<lengths;i++) { if('a'<=qkeys.charAt(i)&&qkeys.charAt(i)<='w') { c= (char)(qkeys.charAt(i)+3); System.out.println(c); } else if('x'<=qkeys.charAt(i)&&qkeys.charAt(i)<='z') { c=(char) (qkeys.charAt(i)-23); System.out.println(c); } else if(qkeys.charAt(i)==' ') { c=qkeys.charAt(i); System.out.println(c); } else if('A'<=qkeys.charAt(i)&&qkeys.charAt(i)<='W') { c=(char) (qkeys.charAt(i)+3); System.out.println(c); } else if('X'<=qkeys.charAt(i)&&qkeys.charAt(i)<='Z') { c=(char) (qkeys.charAt(i)-23); System.out.println(c); } else { System.out.println("请您输入不含数字及特殊字符的字符串!"); break; } } } }