|시간 제한||메모리 제한||제출||정답||맞은 사람||정답 비율|
|1 초||256 MB||0||0||0||0.000%|
There are many markup notations – systems for annotating text with formatting instructions. Markleft is yet another such system. Your task is to implement it.
Markleft takes text input in which punctuation characters are used as follows:
^characters should be converted to upper case
One^tWo^threEwill be converted to
\characters should have all double quotes prefixed with
Piglet \said "Hello"\becomes
Piglet said \"Hello\"
#characters will have all embedded numbers (there will never be more than 6 digits in a number) converted to hexadecimal
#Text with 31 12 and 64#becomes
Text with 1F C and 40
<characters should be reversed
This <be reversed<oddbecomes
This desrever ebodd
@characters should be copied verbatim – ie: markup is ignored. Note that this means that there is no way of getting
@characters into the output.
This is @\<<#@ verbatimbecomes
This is \<<# verbatim
Markleft sections may be nested, but if so must be nested properly (like matching brackets).
The following is illegal because the nesting is improper.
One #reverse me ^uppercase me # and more^
Markleft sections are closed by the first validly nested markleft character. There is no nesting in this example
But nested marklefts of the same kind are possible sometimes. Usually they have little effect, but:
The markleft application processes innermost nested sections first
Input consists of a number of lines of “marked left” text to be formatted. Lines of input are no longer than 100 characters. Each line should be formatted independently. You may assume that lines have valid markup. The end of input is signalled by a line with just a
Lines of formatted text.
One^tWo^threE Piglet \said "Hello"\ #Text with 31 12 and 64# This <be reversed<odd This is @\<<#@ verbatim ^aa<bcd<ee^ abc^def^ghi^jkl^mno ab<cd^ef<gh<ij^kl<mn <#31#< #
OneTWOthreE Piglet said \"Hello\" Text with 1F C and 40 This desrever ebodd This is \<<# verbatim AADCBEE abcDEFghiJKLmno ablkJIGHFEdcmn F1