import java.io.IOException;
import java.util.Scanner;
public class CaesarCode {
public static char[] s = new char[10];
public static int n;
public void set(){
System.out.println("please intput the CaesarCode number:");
Scanner in = new Scanner(System.in);
n = in.nextInt();
}
public void realCode(){
System.out.println("please input your word:");
for(int i = 0;i < s.length;i++){
try {
s[i] = (char) (System.in.read());
} catch (IOException e) {
e.printStackTrace();
}
}
}
public void fakeCode(){
System.out.println("The fakecode is shown below:");
for(int i = 0;i < s.length;i++){
s[i] = (char) ((s[i])+n);
System.out.print(s[i]);
}
}
public static void main(String[] args) {
CaesarCode c = new CaesarCode();
c.set();
c.realCode();
c.fakeCode();
}
}
小白笔记-----CaesarCode
最新推荐文章于 2022-05-07 00:05:01 发布