问题1990--Syntax Included

1990: Syntax Included

[命题人 : ]
时间限制 : 1.000 sec  内存限制 : 64 MB

题目描述

You are writing your first website and seem to be making your fair share of simple HTML syntax errors. You have decided to write an HTML parser to help you determine if your HTML code is syntactically correct based on the following condensed HTML definition:
HTML CODE<HTML>BODY</HTML>
BODY<BODY>TEXT</BODY>
TEXTSTRING |STRING TEXT |TAG |TAG TEXT
STRINGpossibly empty string of printable characters other than '<' and '>')
TAGBOLD |ITALICS |LINK
BOLD<B>TEXT</B>
ITALICS<I>TEXT</I>
LINK<A HREF=URL>TEXT</A>
URLhttp://STRING.com

输入

The first line contains a single integer n indicating the number of data sets.

The following n lines each represent a data set and consists of up to 1000 characters. Spaces can be contained anywhere within the data set.

Note that all tags are case sensitive.

输出

If the code is syntactically correct, the following string will be printed:

"Syntax Included"

Otherwise the following string will be printed:

"No Syntax Included"

样例输入 Copy

<font face="Times New Roman" size=3><pre>3
<HTML><BODY><B>Hello world!</B></BODY></HTML>
<HTML><BODY><B>Is this correct?</B></HTML>
<HTML><BODY><A HREF=http://www.go.com>link</A></BODY></HTML>
</pre></font></p>

样例输出 Copy

<font face="Times New Roman" size=3><pre>Syntax Included
No Syntax Included
Syntax Included
</pre></font></p>

来源/分类