Go to diff to previous submission
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package bugs; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; /** * * @author student */ public class Bugs { /** * @param args the command line arguments */ ArrayList<String> rows = new ArrayList<String>(); while(row.length()>0) { for (int i = 0; i < rowCount; i++) { rows.add(tmp); } } } } }
--- c4.s954.cteam124.bugs.java.0.Bugs.java +++ c4.s966.cteam124.bugs.java.0.Bugs.java @@ -28,15 +28,7 @@ while(row.length()>0) { Integer whiteChar = row.toString().indexOf(" "); - String[] split = row.toString().split(" "); - int rowCount = 0; - String text; - if (split.length == 2) { - rowCount = Integer.parseInt(split[0]); - text= split[1]; - } else { - rowCount = Integer.parseInt(split[0]); - text= " "; - } + int rowCount = Integer.valueOf(row.substring(0, whiteChar)); + String text = row.substring(whiteChar+1, row.length());