我的代码会引发异常。为什么呢?
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.
引发错误:fatal: syntax error ";" expected but "identifier AMOUNT" found
分号应该去哪里?
答案 0 :(得分:5)
将begin
放在var
之后。
我多年没有使用过Pascal,也没有任何编译器来测试它,但它应该是这样的:
program Masquerade(input, output);
var
amount, count, money : integer;
begin
writeln ('Welcome to the Wonder True Masquerade Band');
...