老师好:我昨天做完时已经是11点多了,错过了提交时间,希望用此篇博客弥补一下我的过失。

import java.io.;
import java.lang.;
import java.util.Scanner;
public class MyCP {
public static void main(String args[]) {
try {
FileReader file=new FileReader("/Users/windows/Desktop/mycp.txt");
OutputStreamWriter binary=new OutputStreamWriter(new FileOutputStream("/Users/windows/Desktop/mycp.txt"));
BufferedReader br=new BufferedReader(file);
String strs=null; while ((strs=br.readLine())!=null) { System.out.println(strs);
int num=Integer.parseInt(strs);
//for (int i=0;i<strs.length();i++){ binary.write(Integer.toBinaryString(num));
System.out.print(Integer.toBinaryString(num));
//} }
binary.close();
} catch (FileNotFoundException e) {
System.out.println(" NO file exist");
} catch (IOException e) {
e.printStackTrace();
} System.out.println();
try { FileReader file2=new FileReader("C:\Users\lenovo\zhuanyedajiesanshinian20155307\zhuanyedajiesanshinian20155307");
OutputStreamWriter test=new OutputStreamWriter(new FileOutputStream("C:\\Users\\LJY\\IdeaProjects\\Stream\\src\\test2.txt"));
BufferedReader br2=new BufferedReader(file2);
String strs2=null; while ((strs2=br2.readLine())!=null) { System.out.println(strs2);
//int num2=Integer.parseInt(strs2);
//for (int i=0;i<strs.length();i++){ test.write(Integer.parseInt(strs2,2));
System.out.println(Integer.parseInt(strs2,2));
//} }
test.close();
} catch (FileNotFoundException e) {
System.out.println("file doesn't exist");
} catch (IOException e) {
e.printStackTrace();
} }
}

mycp码云链接

最新文章

  1. 浅谈SQL注入风险 - 一个Login拿下Server
  2. httphandler和httpmodule的区别
  3. Linux基础-目录结构
  4. windows里面的批处理命令不停地处理同一条命令
  5. PYTHON FABRIC实现远程操作和部署
  6. Quartus13.0破解方法
  7. FreeBSD 路由详解
  8. java常见内存溢出(OOM)
  9. 分页技术之GridView控件
  10. 一个跨域请求的XSS漏洞
  11. 【Cocos2d-X游戏实战开发】捕鱼达人之开发前准备工作(一)
  12. Linux软件安装管理 - CentOS (二)
  13. asp.net core 编译mvc,routing,security源代码进行本地调试
  14. WinForm中ClickOnce发布至广域网
  15. hadoop配置遇到问题的解决
  16. Android开发 ViewConfiguration 用法
  17. mysql把查询结果集插入到表理
  18. 附006.harbor.cfg配置文件详解
  19. 基于spec互评Alpha版本
  20. 修改Tomcat的网页端口和指向路径

热门文章

  1. 双十一问题:在洪峰数据来临的瞬间,redis出现连接超时异常
  2. jquery 中 $.map 用法
  3. facebook开源的代码审核工具phabricator
  4. 洛谷 P4841 城市规划
  5. python 中的Array,Value及内存共享
  6. Odoo工作流
  7. 网络测量中基于Sketch方法的调查
  8. Decorator(装饰)模式
  9. mysql查询某个数据库表的数量
  10. Python 学习笔记(十五)Python类拓展(二)方法