Editorial for COCI '12 Contest 1 #1 DOM


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

Using a for loop, we traverse the input string and output each letter if it is neither C, nor A, nor M, nor B, nor R, nor I, nor D, nor G, nor E.

If we want to avoid writing nine conditions, we can use a variable containing the string CAMBRIDGE and a nested loop over that string checking whether any letter matches the current letter from the input string.


Comments

There are no comments at the moment.