ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Сборники > Data Structures > задача:


50429 - Secret Message

Гость
• Вопросы к жюри (1)

Задачи сборника

• 50805 - Sum of the weights in a BST
• 50712 - Moon algebra
• 50978 - Albanian Coders
• 50699 - Fighting Vampires
• 50679 - Jetpack Hurdle Jumping
• 50717 - Hurdle Jumping
• 50692 - How much money?
• 50431 - Sultan's Game
• 50429 - Secret Message
• 50818 - Depth Limited BST
• 50386 - Conformity
• 50790 - Fire Alarm
• 50710 - Permutations
• 50709 - k-ary Strings
• 50708 - Binary Strings
• 50694 - The Cheapest Flight
• 50996 - Checkers - the shortest path

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Question by Halil Karimis.

Secret Message

Question: There are two friends who want to send short secret messages to each other. They found a special coding system which can be solved only by these two boys.

The system: There is a string of characters. There is a special role of "*" sign which removes the previous letter in the string, k "*" signs remove k previous letters.

Solution: There are two strings 'E' and 'D'.'E' is the given encrypted text line. The program should check 'E' so that if next element of 'E' is not '*' then writes the element into decrypted 'D', if not than remove the last element of 'E' without adding the '*' sign.

Input specification
There is one line of text which can contain any letters and symbols. Maximum length of text can be 255 characters.

Output specification
Print the secret message without any '*' characters.

 Sample Input I     Sample Input II   
 mx*erw*ho*abe*a
 lok*okl* u*ay*t t*tho*p*e e*sku*y
 Sample Output I     Sample Output II   
 merhaba
 look at the sky


Для отправки решений необходимо выполнить вход.

www.contester.ru