| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 512 MB | 0 | 0 | 0 | 0.000% |
When you are entering program text into a development environment editor, there is usually a prediction system which will use your current context to help you by listing completions of the symbol you are typing or a symbol you could type next. Your task is to write a program to provide such predictions for the language “NZPC Speak”
The rules for writing NZPC Speak programs are as follows
{
int abc, abcd, abcdef;
float ab, x, xy, xz;
abc = 12 * xy + 99;
{
float abc;
int xy;
xy = abc + abcd;
}
}
The text in the box is an NZPC Speak program. Your program will be presented with truncated syntactically correct NZPC Speak programs and will determine the ‘next’ symbol.
Input is a single line holding the number of problems to be solved. Each problem takes the form of a number of lines (between 1 and 100 inclusive) of program text. The final line of text for each problem will end with an ‘@’ character.
For each problem the output will be a line with ‘Problem # where # is the problem number (1, 2, …) followed by zero or more lines, each holding a predicted ‘next’ symbol. Next symbols will be listed in alphabetic order, where alphabetic is interpreted as the ASCII code ordering with upper and lower case characters interleaved as follows.
This order for the characters used in NZPC Speak is: * , / ; _ { } + = 0…9 a A b B … z Z
Names will be output followed by their types (int or float) in parentheses.
6
{@
{in@
{int@
{int @
{int abc; abc @
{int abc, ab;
a@
Problem 1
{
}
float
int
Problem 2
int
Problem 3
int
Problem 4
Problem 5
=
Problem 6
ab(int)
abc(int)