public class Codes {
public static void main(String[] args){
int [] key={5,12,-3,8,-9,4,10};
Integer keyvalue;
String encoded=null,decoded=null;
String message="dasdasdasdasdasdafdf";
Queue<Integer> encodingQueue=new LinkedList<Integer>();
Queue<Integer> decodingQueue=new LinkedList<Integer>();
for(int i=0;i<key.length;i++){
encodingQueue.add(key[i]);
}
for(int j=0;j<message.length();j++){
keyvalue=encodingQueue.remove();
encoded+=(char)message.charAt(j)+keyvalue;
encodingQueue.add(keyvalue);
}
System.out.println(encoded);
慕设计2395807
慕设计2395807
相关分类