pascal 程序中的非法表达式
我下面的代码抛出异常。为什么?
program Masquerade(input, output);
Begin
var amount, count, money : integer;
writeln ('Welcome to the Wonder True Masquerade Band');
writeln ('Would you like to proceed? Yes/No');
var choice : String;
readln (choice);
End.
抛出错误:致命:语法错误“;”符合预期,但发现“标识符 AMOUNT”
分号应该放在哪里?
My code below throws an exception. Why?
program Masquerade(input, output);
Begin
var amount, count, money : integer;
writeln ('Welcome to the Wonder True Masquerade Band');
writeln ('Would you like to proceed? Yes/No');
var choice : String;
readln (choice);
End.
Throws the error: fatal: syntax error ";" expected but "identifier AMOUNT" found
Where should the semi-colon go?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将
begin
放在var
之后。我已经很多年没有使用 Pascal 了,也没有任何编译器来测试它,但它应该是这样的:
Put
begin
aftervar
.I haven't used Pascal for years and don't have any compiler to test it, but it should be like this: