1#
大 中
小 發表於 2014-4-20 07:47 PM (第 3630 天)
只看該作者
有冇人幫我睇下Pascal程序點改
program search;
var z:string;
function checkinput(x:string):string;
var a,b:boolean;
c:integer;
begin
a:=false;
b:=false;
if length(x)<=12 then a:=true;
第10行 for c:=1 to length(x) do if ord(x[c])>=97 and ord(x[c])<=122
then b:=true;
if (a=true) and (b=true) then checkinput:='Your input is acceptable.'
else if (a=false) and (b=true) then checkinput:='Your input is over 12 letters.'
else if (a=true) and (b=false) then checkinput:='Your input must be english in small letters.'
else checkinput:='Please read the guide before inputting.'
end;
begin
write('Your input?');
readln(z);
writeln(checkinput(z));
readln;
第23行end.
10 / 40 ictsba~1.pas Error: Incompatible types: got "BOOLEAN" expected "LONGINT"
23 ictsba~1.pas Fatal: There were 1 errors compiling module, stopping