A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

第一次回帖就错了,已经更新

date28.zip

968 Bytes, 阅读权限: 200, 下载次数: 1

评分

参与人数 1技术分 +2 收起 理由
王震阳老师 + 2 赞一个!

查看全部评分

回复 使用道具 举报
左左de右手 发表于 2014-12-27 14:58
办法太笨了,不过总算是实现了

已经更新,呵呵,在281#
回复 使用道具 举报
左左de右手 发表于 2014-12-27 15:32
第一次回帖就错了,已经更新

赞一个,继续努力,加油。
回复 使用道具 举报
终于弄完了,不知道对不对

b.jpg (26.93 KB, 下载次数: 8)

b.jpg

d.jpg (21.84 KB, 下载次数: 9)

d.jpg

阿丹435.zip

27.22 KB, 下载次数: 140

评分

参与人数 1技术分 +2 收起 理由
王震阳老师 + 2 赞一个!

查看全部评分

回复 使用道具 举报
领题领题
回复 使用道具 举报
代码写的搓   但是  还是搞定了!!!

yang30.png (74.12 KB, 下载次数: 6)

yang30.png

yang30.zip

112.42 KB, 下载次数: 118

评分

参与人数 1技术分 +2 收起 理由
王震阳老师 + 2 赞一个!

查看全部评分

回复 使用道具 举报
真的饿假的的
回复 使用道具 举报
看题学习
回复 使用道具 举报
油茶籽 来自手机 中级黑马 2014-12-27 23:09:36
289#
不知道能不能做出来
回复 使用道具 举报
来试试,加油
回复 使用道具 举报
来领题啦,试试这段时间学的怎么样。:lol
回复 使用道具 举报
我要技术分
回复 使用道具 举报
我要技术分!!!
回复 使用道具 举报
看看题目!!!!
回复 使用道具 举报
need for technology score~~~~

30.zip

12.58 KB, 阅读权限: 200, 下载次数: 1

评分

参与人数 1技术分 +2 收起 理由
王震阳老师 + 2 赞一个!

查看全部评分

回复 使用道具 举报
阳哥求技术分啊

2014-12-28_193120.jpg (43.38 KB, 下载次数: 7)

题1

题1

2014-12-28_225932.jpg (37.67 KB, 下载次数: 8)

题2

题2

第三十期.rar

4.86 KB, 阅读权限: 200, 下载次数: 1

评分

参与人数 1技术分 +2 收起 理由
王震阳老师 + 2 赞一个!

查看全部评分

回复 使用道具 举报
IO流的题确实有点难,刚看了一点,哎,还需要努力啊
回复 使用道具 举报
郁闷,做错了,还能改不
回复 使用道具 举报
tmac1999 发表于 2014-12-28 20:29
need for technology score~~~~

赞一个:
  1. package heimatest;
  2. //①将a.txt文件中的所有奇数行(也就是第1、3行)字母跟数字互换(比如第一行,处理后为:1a 2a 3a 4a),偶数行顺序倒序排列(比如第二行,处理后为:b4 b3 b2 b1),然后将结果保存在b.txt中。
  3. //②将c.txt中的数字进行如下运算,第n行m列是第(n-1)行第m列的数字之和(提示:第一行不变,第二行变为:6 8 10 12,第三行变为:15 18 21 24,第四行变为28 32 36 40),然后将计算结保存在d.txt中。
  4. import java.io.BufferedReader;
  5. import java.io.BufferedWriter;
  6. import java.io.FileNotFoundException;
  7. import java.io.FileReader;
  8. import java.io.FileWriter;
  9. import java.io.IOException;
  10. import java.io.PrintStream;

  11. public class TxtOperator {
  12.         public static void main(String[] args) throws IOException{
  13.                 creatTestA();
  14.                 creatTestC();
  15.                 OperatorTextA();
  16.                 OperatorTextB();
  17.                
  18.         }
  19.        
  20.         private static void OperatorTextA() throws IOException {
  21.                 BufferedReader br = new BufferedReader(new FileReader("a.txt"));
  22.                 BufferedWriter bw = new BufferedWriter(new FileWriter("b.txt"));
  23.                 String str;
  24.                 int count = 0;
  25.                         while((str = br.readLine())!=null){
  26.                                 count++;
  27.                                 if(count%2==1){
  28.                                         String newstr = str.replaceAll("(\\D)(\\d)", "$2$1");
  29.                                         bw.write(newstr);
  30.                                         bw.newLine();
  31.                                 }
  32.                                 else{
  33.                                         String[] strarray = str.split(" +");
  34.                                         for(int i =strarray.length-1;i>=0;i--){
  35.                                                 bw.write(strarray[i]+" ");                                               
  36.                                         }
  37.                                         bw.newLine();
  38.                                 }
  39.                         }
  40.                 br.close();
  41.                 bw.close();
  42.                
  43.                
  44.         }
  45.         private static void OperatorTextB() throws IOException {
  46.                 BufferedReader br = new BufferedReader(new FileReader("c.txt"));
  47.                 BufferedWriter bw = new BufferedWriter(new FileWriter("d.txt"));
  48.                 String str =null;
  49.                 int[][] ints =new int[4][4];
  50.                 int[][] newint =new int[4][4];
  51.                 int count =0;
  52.                 while ((str = br.readLine())!=null){                       
  53.                         String[] newstr = str.split(" ");                       
  54.                         for(int i=0;i<=3;i++){
  55.                                 ints[count][i] = Integer.parseInt(newstr[i]);
  56.                         }
  57.                         count++;                                               
  58.                 }
  59.                 for(count = 0;count <=3;count++){
  60.                         switch(count){
  61.                                 case 0:for(int i =0;i <=3;i++){
  62.                                                 bw.write(ints[count][i]+" ");
  63.                                 }
  64.                                 bw.newLine();
  65.                                 break;
  66.                                 case 1:for(int i =0;i <=3;i++){
  67.                                         newint[count][i] = ints[count][i]+ints[count-1][i];
  68.                                         bw.write(newint[count][i]+" ");
  69.                                 }
  70.                                 bw.newLine();
  71.                                 break;
  72.                                 case 2:for(int i =0;i <=3;i++){
  73.                                         newint[count][i] = ints[count][i]+ints[count-1][i]+ints[count-2][i];
  74.                                         bw.write(newint[count][i]+" ");
  75.                                 }
  76.                                 bw.newLine();
  77.                                 break;
  78.                                 case 3:for(int i =0;i <=3;i++){
  79.                                         newint[count][i] = ints[count][i]+ints[count-1][i]+ints[count-2][i]+ints[count-3][i];
  80.                                         bw.write(newint[count][i]+" ");
  81.                                 }
  82.                                 bw.newLine();
  83.                                 break;
  84.                         }
  85.                 }
  86.                 br.close();
  87.                 bw.close();
  88.                        
  89.         }
  90.         private static void creatTestA() throws IOException {
  91.                 FileWriter fw = new FileWriter("a.txt");
  92.                 BufferedWriter bw = new BufferedWriter(fw);
  93.                
  94.                 bw.write("a1 a2 a3 a4");
  95.                 bw.newLine();
  96.                 bw.write("b1 b2 b3 b4");
  97.                 bw.newLine();
  98.                 bw.write("c1 c2 c3 c4");
  99.                 bw.newLine();
  100.                 bw.write("d1 d2 d3 d4");// TODO Auto-generated method stub
  101.                 bw.close();
  102.         }
  103.         private static void creatTestC() throws IOException {
  104.                 FileWriter fw = new FileWriter("c.txt");
  105.                 BufferedWriter bw = new BufferedWriter(fw);
  106.                
  107.                 bw.write("1 2 3 4");
  108.                 bw.newLine();
  109.                 bw.write("5 6 7 8");
  110.                 bw.newLine();
  111.                 bw.write("9 10 11 12");
  112.                 bw.newLine();
  113.                 bw.write("13 14 15 16");// TODO Auto-generated method stub
  114.                 bw.close();
  115.         }
  116. }
复制代码
回复 使用道具 举报
来看看,
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马