主题:菜鸟求助:repeat语句的一个让我困惑的运行结果
我是个菜鸟,从来没用过units,今天小小的试验了crt的until keypressed.但执行后发
现输出的结果有正有负,正数很正常,可是怎么会有负数哪?恳请各位大侠帮帮我,不要因为问题太白痴而不理我呀.
uses
crt;
var
a:integer;
begin
a:=0;
repeat
a:=a+1;
until keypressed;
writeln('a has been added to itself ',a,' times.');
end.
现输出的结果有正有负,正数很正常,可是怎么会有负数哪?恳请各位大侠帮帮我,不要因为问题太白痴而不理我呀.
uses
crt;
var
a:integer;
begin
a:=0;
repeat
a:=a+1;
until keypressed;
writeln('a has been added to itself ',a,' times.');
end.