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) { int rowCount = 0; String text; if (split.length == 2) { text= split[1]; } else { text= " "; } for (int i = 0; i < rowCount; i++) { rows.add(tmp); } } } } }
--- c4.s934.cteam124.bugs.java.0.Bugs.java +++ c4.s954.cteam124.bugs.java.0.Bugs.java @@ -27,7 +27,18 @@ while(row.length()>0) { + Integer whiteChar = row.toString().indexOf(" "); String[] split = row.toString().split(" "); - int rowCount = Integer.valueOf(split[0]); - String text = split[1]; + + int rowCount = 0; + String text; + if (split.length == 2) { + rowCount = Integer.parseInt(split[0]); + text= split[1]; + } else { + rowCount = Integer.parseInt(split[0]); + text= " "; + } + + for (int i = 0; i < rowCount; i++) {