Programming contests

ACM Central European Regional Contest, Prague, 2007, 2011, Practice Session

November 29, 2011 6:45 PM – February 1, 2012 12:00 AM

Software Bugs

The biggest problem for all software developers are bugs. You definitely know the situation when a user calls to say "I've found a bug in your program". Once you have found and removed the bug, another one appears immediately. It is a hard and never-ending process.

Recently, there appeared a promising open-source initiative called "bug-preprocessor". The bug- preprocessor is a program able to find all bugs in your source code and mark them, so they are relatively easy to be removed. Your task is to write a program that will remove all marked bugs from the preprocessed source code.

Input Specification

The input contains a text representing the preprocessed source code, an unspecified number of lines of text, some of them may be empty. Bugs are represented by a case-sensitive string "BUG". The text is terminated by the end of file. No line in the input will be longer than 100 characters.

Output Specification

Your program must remove all of the bugs from the input and print a text that does not contain any BUG strings. Nothing else than bugs may be removed, not even spaces.

Sample Input

  1. print "No bugs here..."
  3. void hello() {
  5.     printfBUG("Hello, world!\n");
  6. }
  8. wriBUGBUGtelBUGn("Hello B-U-G");
download as text file

Output for Sample Input

  1. print "No bugs here..."
  3. void hello() {
  4.     printf("Hello, world!\n");
  5. }
  7. writeln("Hello B-U-G");
download as text file
University of Debrecen; Faculty of Informatics; v. 03/01/2019