Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb. 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
|
Для отправки решений необходимо выполнить вход.
|