var i:longint; begin for i:=100 to 999 do begin if ((i div 1) < (i div 10 mod 10) < (i mod 10) then write(i); else write(' '); writeln; end; readln; end. 哪错了? Pascal程序
qq_笑_17
浏览 376回答 2
2回答
MM们
3个错:1.if ((i div 1) < (i div 10 mod 10) < (i mod 10)少半个“)”2.if ((i div 1) < (i div 10 mod 10) < (i mod 10) then write(i);由于下一行是else,所以不能有“;”3.if ((i div 1) < (i div 10 mod 10) < (i mod 10) then write(i);Pascal里面不能有连续3个条件判断正误(如:a>b>c)应写为:var i:longint;beginfor i:=100 to 999 do beginif ((i div 1) < (i div 10 mod 10))and((i div 10 mod 10)< (i mod 10)) then write(i)else write(' ');writeln;end;readln;end.