2016-04-24 67 views
-1

我有,因为这代码不会在编译器工作的另一个问题......对于很多问题对不起,我想其他问题将遵循:定义最大帕斯卡尔

program findMaximum(input,output); 

var 
    number, Maximum: integer; 
begin 
    writeln('Insert a number and finish up with 0'). 
    while number < >0 do 
    begin 
     if number> Maximum then 
      Maximum := number; 
     readln(number) 
    end; 
    if Maximum <> 0 then 
     writeln('The biggest number is',Maximum) 
    else 
     writeln('The input was zero.') 
end. 
+0

遗憾的写作。它是缩进的。我仍然需要学习如何在这里发布实际显示为缩进的代码。 – Christina

+0

问题到底是什么?是否有错误讯息? – Codor

+0

输出是预期的“标识符”,但找到“WHILE”。在我被告知致命:语法错误,“;”预期但找到“标识符最大值”。 在这两种情况下都存在语法错误*它表示* – Christina

回答

-3
var 
number, Maximum: integer; 
begin 
maximum:=0; 
writeln('Insert a number and finish up with 0'); 
while number < >0 do 
begin 
readln(number); 

if number> Maximum then Maximum := number; 
end; 

if Maximum <> 0 then 
    writeln('The biggest number is',Maximum) 
else 
    writeln('The input was zero.') 
end. 
+0

第一次写入的行应以分号结尾,否则不带圆点。 –

+0

是的,是一个错字。固定。 – DrWael