/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package acm; import java.util.Scanner; /** * * @author cteam030 */ public class Bugs { while(s.hasNext()) { int lines = s.nextInt(); s.nextLine(); for(int i = 0; i < lines; i++) { line = s.nextLine(); while(line.contains(bug)) { line = line.replace(bug, ""); } } } } }