当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3528:The Simple Programming Language

题目描述
Consider the following programming language. This language contains only two types of statements: simple statements and compound statements. The simple statement is in the form “write (literal)”, where “write” is a key word indicating that the content of the literal should be written to the standard output. The content of literals is surrounded by a pair of double quotes. The compound statement is in the form “if (<expression>) <statement>” or “if (<expression>) <statement> else <statement>”. Here “if” and “else” are key words and “expression” can be either “1” or “0” indicating “true” or “false”. Statement can be either compound or simple, which means compound statements can be nested. Note that each “else” should match the nearest “if”.
输入解释
The input has multiple test cases. Every test case is exactly a statement. Every test case is ended with an empty line and there will be no empty lines within a statement. Please pay attention that empty lines separate the statements and adjacent statements are independent of each other.
输出解释
For all the contents of literals that should be written to the standard output, print them on a single line, without the double quotes. The contents of literals will contain only lower case letters.
输入样例
write(“q”)

if(0) write(“x”) else write(“y”)

if(1) if(0) write(“x”) else write(“y”)

if(0) if(0) write(“x”) else write(“y”)
输出样例
q
y
y

提示
The 4th test case has no output.
来自杭电HDUOJ的附加信息
Recommend zhengfeng

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-3528

最后修改于 2020-10-25T23:04:27+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 65536/32768K(Java/Others)