今日站立会议照片:
今日工作和学习总结:
- 完成的工作:
今天我们已完成《英语单词最长编辑器》的全部代码的编辑工作,和《黄金点计算器》的部分代码的编辑工作。
-
工作总结:
经过昨天的编辑我们发现,随机组合英语单词使之达到最大长度不是一般的有难度,我们当初选择题目时的奋斗目标就是为了挑战自我,所以这个题目也真正的达到 了我们的目的,我们的编程人员遇到了前所未有的麻烦,好在我们的编程人员夜以继日的赶工、加班,我相信我们团队一定能够按时完成任务。
同时,今天我们将完成对《黄金点计算器》的初步编辑,具体的思路我们已经有了,这个程序和我们之前编辑的接龙程序相比,难度上稍微的简单一点,代码的实现 方面也容易一点。
未来两天,我们将对我们的程序进行系统化的优化,我们将以饱满的精神状态面对我们的四天实训,困难不会打倒我们,只会让我们变得更加的锋利!!!
- 具体代码:
-
1 import java.io.*; 2 import java.lang.*; 3 public class jl 4 { 5 static String y =""; 6 public static void main(String [ ] args) 7 { 8 int i = 0; 9 10 String tempString = ""; 11 12 String[] a = new String[20]; 13 String[] b = new String[9]; 14 try { 15 FileReader fileReader = new FileReader("a.txt"); 16 BufferedReader buf = new BufferedReader(fileReader); 17 18 for (i=0; (tempString = buf.readLine()) != null; i++){ 19 a[i] = tempString; 20 21 } 22 } 23 catch (Exception e) { 24 e.printStackTrace(); 25 } 26 for (int j=0 ;j<b.length;j++) 27 { 28 b[j]=a[j].toLowerCase(); 29 //System.out.println(b[j]); 30 } 31 //遍历字符串数组 32 for (int m=0;m<b.length;m++) 33 { 34 //取字符尾字母 35 char tail=b[m].charAt(b[m].length()-1); 36 //将字符尾字母与字符比较,遍历第一个字符后的字符串数组 37 for (int x=m+1;x<b.length;x++) 38 { 39 //取字符首字母 40 char head=b[x].charAt(0); 41 //如果字符尾字母与字符首字母相同 42 if (tail==head) 43 { 44 //tail=a[x].charAt(a[x].length()-1); 45 //将第一个字符与第二个字符拼接 46 if (y==""){ 47 y=y+a[m]+"+"+a[x]; 48 String s2 = a[m]+"\r\n"; 49 byte []b1 = s2.getBytes(); 50 String s3 = a[x]+"\r\n"; 51 byte []b2 = s3.getBytes(); 52 try { 53 FileOutputStream f = new FileOutputStream("b.txt",true); 54 f.write(b1); 55 f.write(b2); 56 f.flush(); 57 f.close(); 58 } 59 catch(Exception e){ 60 61 } 62 63 } 64 else{ 65 y=y+"+"+a[x]; 66 try { 67 byte []b1 = a[x].getBytes(); 68 FileOutputStream f = new FileOutputStream("b.txt",true); 69 //f.write(b1); 70 f.write(b1); 71 f.flush(); 72 f.close(); 73 } 74 catch(Exception e){ 75 76 } 77 System.out.println (y); 78 } 79 } 80 } 81 } 82 } 83 }