I have two interesting questions...
If there's a line " if a<b .." in the pascal source file, how to avoid the conflict between '<' in string and '<' in HTML command?
how about:
writeln('1232134{32q421}');
will "{}" be considered as comment?
I have two interesting answers :) (+)
>If there's a line " if a<b .." in the pascal source file, how to avoid the conflict between '<' in string and '<' in HTML command?
Don't worry about it :)
>how about:
>writeln('1232134{32q421}');
>will "{}" be considered as comment?
No. You should output:
writeln(<span class=string>'1232134{32q421}'</span>);
P.S. The problem definition is unclear. While solving it I had some questions like:
- what about "a:=1.23E10"?
- what about "s:=#123#123"?
and so on. But it appeared you should not pay special attention to these test cases. The best way to solve this problem is finite automaton - just build it carefully.
P.P.S. You have solved Ural-1340 "Cucaracha". My congratulations :)
Edited by author 26.02.2005 12:22
Re: I have two interesting answers :) (+)
Thanx:)
I used something just like finite automaton.
my friends told me that the input file might not be a correct pascal file. I asked him the following tests:
his answer is in (). are these all right?
# (#)
#123445.53656 ( <s>#123445</s>.<s>53656</s> )
{1234{252}32452} ( <s>{1234{252}</s><s num>32452</s>} )
23423.525.2345 ( <s>23423.525</s>.<s>2345</s> )
.62345654 ( .<s>62345654</s> )
{134234//23421434 } 2134234} ( <s com>{134234//23421434 }</s> <s num>2134234</s>} )
//432523{54325}5432534 ( <s com>//432523{54325}5432534</s> )
BTW i'm using this ID "Love_xx" to test out the test datas :(
Aha, you're quite right. I made a silly mistake!
and there's no need to pay attantion to such messy input.
Re: I have two interesting answers :) (+)
how about:
6472{34123}2314
<span class=number>6472</span><span class=comment>{34123}</span><span class=number>2314</span>
or
<span class=number>6472<span class=comment>{34123}</span>2314</span>
?
The first one is correct (-)
I have answers :)
how about:
#13#14
#$2b
s := #97#98+#$56#98;
#24>#89
My AC program's output (+)
<span class=string>#13</span><span class=string>#14</span>
<span class=string>#</span>$<span class=number>2</span>b
s := <span class=string>#97</span><span class=string>#98</span>+<span class=string>#</span>$<span class=number>56</span><span class=string>#98</span>;
<span class=string>#24</span>><span class=string>#89</span>
Edited by author 25.06.2005 17:44
Re: My AC program's output (+)
Hello Dmitry!
I think your answer is incorrect according to this sentence-
Or a symbol “#” which is followed by nonempty sequence of digits.
My AC program's output:
<span class=string>#13</span><span class=string>#14</span>
#$<span class=number>2</span>b
s := <span class=string>#97</span><span class=string>#98</span>+#$<span class=number>56</span><span class=string>#98</span>;
<span class=string>#24</span>><span class=string>#89</span>