当前位置: 首页 > news >正文

做策划的人经常浏览的网站平面设计培训机构排名

做策划的人经常浏览的网站,平面设计培训机构排名,网速测速,电商平台项目商业计划书day17_io02 1.上课代码敲一遍 2.读取一个文件#xff0c;这个文件中有随机的一些数字字符#xff0c;统计这些数字有几个偶数#xff0c;几个奇数#xff0c;并且追加写入到该文件末尾。 例如#xff1a; a.txt文件#xff1a; 3241256364789629090126581212515 奇数这个文件中有随机的一些数字字符统计这些数字有几个偶数几个奇数并且追加写入到该文件末尾。 例如 a.txt文件 3241256364789629090126581212515 奇数xx个 偶数xx个 package com.cskaoyan._17day;import java.io.*; import java.util.ArrayList;public class Exercise {public static void main(String[] args) throws IOException {try {BufferedReader brnew BufferedReader(new InputStreamReader(new FileInputStream(new File(a.txt))));String lineTxt3241256364789629090126581212515;int a 0;ArrayListString oddnumbernew ArrayList();ArrayListObject evennumbernew ArrayList();while ((lineTxtbr.readLine())!null){a;if (a % 2 0) {oddnumber.add(lineTxt);} else {evennumber.add(lineTxt);}}br.close();}catch (Exception e){System.out.println(read error: e);}} }3.在一个磁盘的文件里保存26个英文小写字母乱序将他们读入内存中进行排序把排好顺序的数再重新追加写到磁盘的该文件中。 package com.cskaoyan._17day; import java.io.*; public class Exercise02 {public static void main(String[] args) throws IOException {FileInputStream sc new FileInputStream(a.txt);Reader reader new InputStreamReader( sc );FileOutputStream s new FileOutputStream(a.txt, true);Writer writernew OutputStreamWriter( s );char[] chars new char[1024];int len;while((len reader.read(chars)) ! -1){bubbleSort(chars,len);writer.write(\n);writer.write(chars,0,len);}reader.close();writer.close();}private static void bubbleSort(char arr[] , int len) {for (int i0; i len -1; i) {for (int j0; j len -1; j) {if (arr[j] arr[j 1]){char temp arr[j];arr[j] arr[j 1];arr[j 1] temp;}}}} } 4.递归查找指定目录中(包括子目录中)所有的.java文件并且把所有这些找到的java文件复制(是复制不是移动)到一个指定的目录下 package com.cskaoyan._17day;import java.io.*; import java.util.ArrayList;public class Exercise03 {public static void main(String[] args) {File sc new File(D:\\);File file new File(D:\\ );file.mkdir();String targetDir ;eachFile(sc);//复制所有。java文件到目标文件夹for (int i0; i file.length(); i) {FileInputStream input null;FileOutputStream output null;try{input new FileInputStream(file.get(i));InputStream inbuffer new BufferedInputStream(input);//目标文件由输出流自己创建output new FileInputStream(targetDir file.get(i).getName());OutputStream outbuffernew BufferedOutputStream(output);//利用字节缓冲流复制文件byte[] b new byte[1024];int len;while ((len inbuffer.read(b)) ! -1){outbuffer.write(b,0,len);}} catch (IOException e) {e.printStackTrace();}finally {closeQuietly(input);closeQuietly(output);}}}public static void closeQuietly(Closeable closeable){try{if (closeable ! null){closeable.close();}} catch (IOException e){e.printStackTrace();}}public static ArrayListFile files new ArrayList();//遍历这个文件夹内的所有子目录和文件public static void eachFile(File file){try{File[] targetFile file.listFiles();for (int i0; i targetFile.length; i) {if (targetFile[i].isDirectory()){eachFile(targetFile[i]);}else{//找到所有的java文件并且放到集合中if (targetFile[i].getName().endsWith(java)){file.add(targetFile[i]);}}}} catch (Exception e){e.printStackTrace();}} } 5.开始写阶段6(慢慢写不急着交,周末也可以写)
http://www.hkea.cn/news/14402316/

相关文章:

  • 中山网站建设排名免费游戏直接进入
  • 旅游兼职网站建设上海到北京物流
  • 手机站点cn上线了做网站怎么查看
  • 大航母网站建设在哪里企业网站广告图片轮播代码
  • 网站的底部导航怎么做站长要维护网站
  • 查询公司信息的网站汕头seo推广优化
  • 住房和城乡建设部网站执业资格注册中心网页设计页面尺寸
  • 广东律师事务所东莞网站建设潭州学院网站建设报名
  • 男女做暖暖的试看网站酥酥影视wordpress允许爬取
  • 网站做的好不好看什么苏州建设网站
  • 成都品牌网站建设电话眉山建设银行官方网站
  • 手机网站怎么写wordpress 漏洞工具
  • 洛阳专业做网站公司描述电子商务网站建设
  • 网站源代码下载动态购物网站
  • 丹寇服饰官方网站爬虫 网站开发实例
  • 云南省建设工程质量协会网站网站开发人员工资计入无形资产
  • wordpress手机网站模版pageadmin模板制作教程
  • 网站是怎么建设的游戏网址
  • 手机备案网站高佣金app软件推广平台
  • 苏州新区高端网站制作网页设计培训班网页设计学校
  • 企业网站 论文购物网站seo搜索引擎前期分析
  • 网站怎么做淘宝客自己做的网站二维码怎么做的
  • 三合一网站平台做药物分析常用网站
  • 网站设计亮点最新军事新闻视频在线观看
  • 裕华区建设局网站文件传输协议登录网站
  • 关于信用体系建设的网站龙岩seo公司
  • wordpress会员网站北京新闻媒体
  • 重庆网站建设大概多少费用企业软件管家
  • 扫描二维码进入公司网站怎样做石基网站建设
  • php做网站的技术难点滑县住房城乡建设厅门户网站