PASCAL错误:直到预期但最终找到

时间:2014-11-13 14:04:55

标签: pascal

我的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.    
你可以帮帮我吗?

1 个答案:

答案 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.