시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 128 MB | 0 | 0 | 0 | 0.000% |
DDL is a very simple programming language in which variables are dynamically declared at run time. All variables in DDL are of the signed integer type within the range -9999...9999. There are up to five types of statements in a DDL program (each statement is in a separate program line, and the first statement is in line 1):
Note that the keywords of the DDL language are case-insensitive.
Error conditions:
When one of the following erroneous statements encounters during the program execution, an error message appears in a separate line of the output. Each error message is of the form <label> <space> <error code>. label is the line number for the erroneous statement, space is one blank character, and error code is a positive integer specified below.
First line of the input file contains a single integer N indicating the number of DDL programs to follow (1 ≤ N ≤ 20). The first line of each test case contains a single integer indicating number of statements in that program which is in the range (1...100). There are no blank lines between test cases. Statements of each DDL program come one after the other in separate lines without any blank lines in between. Statements are not explicitly labeled, but they are implicitly labeled by the number of their line beginning from 1 for the first statement in each program. There is no syntax error in programs and they are guaranteed to terminate, and no overflow or underflow errors will occur during execution. In each line of the program, tokens (e.g. GOTO, =, etc.) are separated by at least one blank character. Also there may be some blank characters in the beginning or at the end of each line.
For each input DDL program, your output should start with the program number in the first line, followed by the error messages generated by the program in the order they are generated, each error message in one line. There should be no blank lines between error messages.
2 4 DCL X INC X DCL X END 9 DCL X INC X GOTO X 5 DCL Y Y = 100 DCL X DCL X Y = 50 END
1 2 5 2 7 1 8 2
ICPC > Regionals > Asia West Continent > Iran > Tehran Site 2000 C번