我的pascal代码有问题。
编译时会显示错误:语法:直到预期但最终找到。
PROGRAM EvilGOTO;
Var rand,count,guess : integer;
LABEL correct, schleife, wrong, ende;
begin
Randomize;
count :=0;
repeat
schleife:
count := count+1;
rand := Random(10);
guess := Random(10);
if rand=guess
then
writeln('Correct')
end
else
writeln('False Guess')
goto schleife
until
count = 10;
end.
你可以帮帮我吗?
答案 0 :(得分:2)
PROGRAM EvilGOTO;
Var rand,count,guess : integer;
begin
Randomize;
count :=0;
repeat
rand := Random(10);
guess := Random(10);
if rand=guess then
writeln('Correct')
else
begin
count := count+1;
writeln('False Guess');
end
until count = 10 or rand=guess;
end.