day2 test06

来源:互联网 发布:等式约束优化 数值求解 编辑:程序博客网 时间:2024/06/06 09:15
package day2;import java.io.*;//加密程序class test06{public static void main(String args[]) throws Exception{FileInputStream fis = new FileInputStream("b.txt");FileOutputStream fos = new FileOutputStream("c.txt");//Hint key = 123;System.out.println("请输入密钥:");BufferedReader br =new BufferedReader(new InputStreamReader(System.in));String line = br.readLine();int key = Integer.parseInt(line);int ch;while((ch=fis.read())!=-1){ch = ch^key;fos.write(ch);}}}

原创粉丝点击