## CCC '98 S1 - Censor

View as PDF

Points: 5
Time limit: 2.0s
Memory limit: 64M

Problem types
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig
##### 1998 Canadian Computing Competition, Stage 1, Problem A

The Society for the Prevention of Profanity on the Internet has observed a growing number of chat lines on the World-Wide Web. A chat line allows a Web user to type lines of text which are transmitted to all other users. The Society is concerned about the number of four-letter words being transmitted by these chat lines and has proposed the mandatory use of software to remove all four-letter words from every transmission. Your job is to write the software to do this removal.

#### Input Specification

The input to your program consists of an integer, n, on a line by itself, followed by n lines of text. Each line of text contains words separated by spaces. Each word consists of letters of the alphabet and exactly one space separates adjacent words. Lines do not exceed 80 characters in length.

#### Output

The output from your program should consist of the n lines of text, with each four-letter word replaced by four asterisks.

#### Sample Input

2
The quick brown fox jumps over the lazy dog
Now is the time for all good people to come to the aid of the party

#### Sample Output

The quick brown fox jumps **** the **** dog
Now is the **** for all **** people to **** to the aid of the party

CCC problem statements in large part from the PEG OJ

• commented on Jan. 13, 2020, 1:19 p.m.

If ur checking for spaces the last word wont have a space after it

• commented on Jan. 28, 2016, 1:05 a.m. edited

Keep getting WA on the first test case. Any suggestions?

UPDATE: I realized my mistake.

• commented on Dec. 13, 2014, 3:09 p.m.

This returns some very interesting results, especially when you take something from the internet and put it into your code.

• commented on March 6, 2016, 3:22 p.m.

returns interesting results, especially you something the internet and put it your .

And it gets worse when you plug that into DMOJ's comments.