首先,我是编程新手,刚开始学习帕斯卡。我遇到了错误 85:“;” 预期的。我多次搜索整个事情,但我一直无法找到问题所在。有什么建议么?
这是代码:
program test;
var
a,b,c:real;
begin
D:=sqr(b)-4*a*c;
writeln('Enter a value for a');
readln(a);
writeln('Enter a value for b');
readln(b);
writeln('Enter a value for c');
readln(c);
if ( D<0 ) then
begin
writeln('There is no solution.');
else
if ( D>0 ) then
begin
x1:=(-b+sqrt(D))/2*a;
x2:=(-b-sqrt(D))/2*a;
writeln('x1 is:');
writeln('x1:=',x1);
writeln(x2 is:);
writeln('x2:=',x2);
end;
end.