Mycp补交作业

代码

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. mycp 补交作业

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

  2. 补交作业-第八周PSP

    一.表格 C(分类) C(内容) S(开始时间) ST(结束时间) I(打断时间) △(净工作时间) 讨论 用户界面 9:30 10:40 15 55 编码 编码 13:20 16:30 10 180 ...

  3. 补交作业——Beta发布评论

    1.飞天小女警: 礼物挑选这一项目是很好的点子,比较能够吸引客户,更加方便快捷的挑选也满足现代人在送礼物方面的需求.这一次的发布界面效果好了很多,并且成功的发布到了云服务器上. 2.nice! : 这 ...

  4. Common xaml controls(补交作业)

    Common xaml controls 常见的xaml控件: 先上一段代码,把他们基本都实现出来: <Grid Name="MyGrid"> <Button N ...

  5. Event(补交作业)

    三种方法可以创建Eventhandler 1.

  6. Layout2:StackPanel(补交作业)

    <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" > <Rect ...

  7. Layout1:Grid(补交作业)

    Layout1:Grid 这一节我们来讲解一下一个layout:gird. 首先上一段代码: <Page x:Class="Gridstudy.MainPage" xmlns ...

  8. 对xaml的深入探究(补交作业)

    首先,下结论,看完那个外国老师的视频后,5%左右听懂了,分享给大家: 1.理解一下,xaml是特殊的xml,我们可以从代码语法看出,xaml中的打码很类似与html和xml的代码. 2.xaml.cs ...

  9. window phone8.1 hello,world(补交作业)

    第一步,我们需要创建一个简单的hello,world程序来帮助我们了解大致的方向. 下面是这个小例子的步骤: 1.打开vs,点击 文件-新建-项目:如图:

随机推荐

  1. 英语零散笔记Note整理

    无意之间整理电脑发现还存放着以前自己看视频做的一些笔记,关于新概念英语的笔记,觉得不错,放于博客,以供学习. English Note1 定语从句 将不重要的动作放在定语从句中,重要的放在主干中. 倒 ...

  2. Qt中限制IP输入的正则表达式:

    这个例子中,是使用QLineEdit加入正则表达式来实现ip地址的输入功能的,不符合规范的数据将不能输入: QRegExp regExpIP("((25[0-5]|2[0-4][0-9]|1 ...

  3. 关于 Can't connect to MySQL server on 'localhost' (10061) 的一个解决方案

    问题描述: 使用Navicat for mysql 无法远程连接到本地数据库,提示Can't connect to MySQL server on 'localhost' (10038) . 本地服务 ...

  4. PDF文件如何转成markdown格式

    百度上根据pdf转makrdown为关键字进行搜索,结果大多数是反过来的转换,即markdown文本转PDF格式. 但是PDF转markdown的解决方案很少. 正好我工作上有这个需求,所以自己实现了 ...

  5. Eclipse html 编辑器插件下载安装

    需要在eclipse里面编辑html和jsp,语法高亮和语法提示,自动补全等. 一.下载GEF(依赖包): 1.下载地址:http://www.eclipse.org/downloads/downlo ...

  6. Apache Kafka系列(七)Kafka Repartition操作

    Kafka提供了重新分区的命令,但是只能增加,不能减少 我的kafka安装在/usr/local/kafka_2.12-1.0.2目录下面, [root@i-zk1 kafka_2.-]# bin/k ...

  7. pop链构造

    class Person { private $name; private $sex; private $age; //__set()方法用来设置私有属性 function __set($proper ...

  8. Linux环境搭建多项目SVN

    1.安装SVN #yum install subversion 2.创建版本库文件夹 #mkdir -p /var/svn/repos/pro1 (/var/svn/repos是根路径,pro1是项目 ...

  9. String 的字面量、常量池、构造函数和intern()函数

    一.内存中的 String 对象 Java 的堆和栈 对于基本数据类型变量和对象的引用,也就是局部变量表属于栈内存: 而通过 new 关键字和 constructor 创建的对象存放在堆内存: 直接的 ...

  10. yii2数据库简单操作

    1.简单查询: one(): 根据查询结果返回查询的第一条记录. all(): 根据查询结果返回所有记录. count(): 返回记录的数量. sum(): 返回指定列的总数. average():  ...