Programming contests

ACM ICPC programozó csapatverseny, országos forduló, gyakorló feladatsor, 2013. október 27.

October 27, 2013 9:00 AM – October 27, 2013 10:00 AM

Mother Bear

Unfortunately for our lazy “heroes”, the nuts were planted by an evil bear known as… Dave, and they've fallen right into his trap. Dave is not just any bear, he's a talking bear, but he can only understand sentences that are palindromes. While Larry was dazed and confused, Ryan figured this out, but need a way to make sure his sentences are palindromic. So he pulled out his trustly iPod, which thankfully have this program you wrote just for this purpose… or did you?

Input Specification

You'll be given many sentences. You have to determine if they are palindromes or not, ignoring case and punctuations. Every sentence will only contain the letters AZ, az, '.', ',', '!', '?'. The end of input will be a line containing the word “DONE”, which should not be processed.

Output Specification

On each input, output “You won't be eaten!” if it is a palindrome, and “Uh oh..” if it is not a palindrome.

Sample Input

  1. Madam, Im adam!
  2. Roma tibi subito motibus ibit amor.
  3. Me so hungry!
  4. Si nummi immunis
  5. DONE
download as text file

Output for Sample Input

  1. You won't be eaten!
  2. You won't be eaten!
  3. Uh oh..
  4. You won't be eaten!
download as text file
University of Debrecen; Faculty of Informatics; v. 03/01/2019