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.IOException; import java.util.ArrayList; import java.util.List; import java.util.Scanner; /** * * @author student */ public class Bugs { /** * @param args the command line arguments */ List<String> result = new ArrayList<String>(); while (line.length() > 0) { Scanner s = new Scanner(line); int rowCount = s.nextInt(); text = text.substring(1, text.length()); for (int i = 0; i < rowCount; i++) { result.add(tmp); } line = scanner.nextLine(); } } } }
--- c4.s1166.cteam124.bugs.java.0.Bugs.java +++ c4.s1283.cteam124.bugs.java.0.Bugs.java @@ -21,12 +21,7 @@ */ public static void main(String[] args) throws IOException { - Scanner sc = new Scanner(System.in); List<String> result = new ArrayList<String>(); - - //BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); - //String line = br.readLine(); - Scanner scanner = new Scanner(System.in); String line = scanner.nextLine(); @@ -35,5 +30,6 @@ Scanner s = new Scanner(line); int rowCount = s.nextInt(); - String text = s.nextLine().trim(); + String text = s.nextLine(); + text = text.substring(1, text.length()); @@ -43,6 +39,6 @@ result.add(tmp); } - line = scanner.nextLine(); + line = scanner.nextLine(); } for (String string : result) {