本區搜索:
Yahoo!字典
打印

[ICT] 有冇人幫我睇下Pascal程序點改

有冇人幫我睇下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
   

TOP

[隱藏]
本人已改正感謝

TOP

回覆 1# erickwong 的帖子

  ICT自己友,以後有我唔洗驚

TOP

重要聲明:小卒資訊論壇 是一個公開的學術交流及分享平台。 論壇內所有檔案及內容 都只可作學術交流之用,絕不能用商業用途。 所有會員均須對自己所發表的言論而引起的法律責任負責(包括上傳檔案或連結), 本壇並不擔保該等資料之準確性及可靠性,且概不會就因有關資料之任何不確或遺漏而引致之任何損失或 損害承擔任何責任(不論是否與侵權行為、訂立契約或其他方面有關 ) 。