|
|
вернуться в форумWhy COMPILATION ERROR!!!!!!!!!!!!!!!!!!!!!!!!! I have a Pascal program. My computer compiles it perfect. I tried in to compile it in Free Pascal and Borland Pascal. It works. Why do I get compilation error? Re: Why COMPILATION ERROR!!!!!!!!!!!!!!!!!!!!!!!!! the judge compiles it with Delphi... Maybe you used a reserved word as variable... check a list of them in delphi on a previous post... Jury uses Free Pascal. Post your code here (-) Just check your e-mail! (+) Select "Reply to this/my E-Mail address" when you submit your code and check e-mail later. In the case of Compilation Error you recieve the list of errors. Re: Just check your e-mail! (+) I tried to compile it in Delphi and it works. I tried to compile it in Free Pascal and it works. What is the problem? I used Quick Sort. Here is my sorce: I hope you will find the problem. type vec=array[1..150000] of longint; var i,n,k:longint; a:vec; b:vec; procedure poz(li,ls:longint); var i,j,c,i1,j1,as:longint; begin i1:=0; j1:=-1; i:=li; j:=ls; while i<j do begin if a[i]<a[j] then begin c:=a[j]; a[j]:=a[i]; a[i]:=c; as:=b[j]; b[j]:=b[i]; b[i]:=as; c:=i1; i1:=-j1; j1:=-c; end; i:=i+i1; j:=j+j1; end; k:=i; end; procedure quick(li,ls:longint); begin if li<ls then begin poz(li,ls); quick(li,k-1); quick(k+1,ls); end; end; begin readln(n); for i:=1 to n do readln(b[i],a[i]); quick(1,n); for i:=1 to n do writeln(b[i],' ',a[i]); end. See in Do you get that message in e-mail?
test.pas(7,17) Fatal: Syntax error, identifier expected but as found
It means that as is a reserved word. Re: See in 'as' is really reserved word so you have to rename it Edited by author 10.09.2004 00:37 |
|
|