|
|
back to boardCommon BoardWhy I got "COMPILATION ERROR" ? It works in my BP 7.0 compiler ! here 's my source :
const INP = '1040.inp'; OUT = '1040.out'; maxn = 50 ; maxm = 1500 ; type ar1 = array[1..maxm] of integer ; ar2 = array[1..maxm,1..15] of integer ; link = ^node ; node = record pt : integer ; next:link ; end; var n,m : integer ; coke : array[1..maxn,1..maxn] of integer; cs : ar1 ; ke : array[1..maxm] of link ; rec,chon,luu : ar1 ; sluoc : ar1 ; uoc : ^ar2 ; kq : boolean ; cung : array[1..maxm] of record a,b : integer ;end; procedure readin ; var i,a,b : integer ; begin fillchar ( coke,sizeof (coke),0); { assign (input,inp); reset(input);} new (uoc) ; readln ( n,m) ; for i:=1 to m do begin readln (a,b) ; cung[i].a:=a; cung[i].b:=b ; coke[a,b]:=1 ; coke[b,a]:=1 ; cs[i]:= (a-1)*n + b ; end ; { close(input);} end; procedure khoitaoke ; var i,j,l : integer; t : link ; begin for i:=1 to n do for j:=i+1 to n do if coke[i,j] = 1 then begin ke[(i-1)*n+j]:=nil; for l:=i+1 to n do if l <> j then if coke[i,l] = 1 then begin new ( t ) ; t^.pt := (i-1)*n+l; t^.next := ke[(i-1) *n+j];ke[(i-1)*n+j]:=t; end; for l:=1 to i-1 do if l <> j then if coke[l,i] = 1 then begin new ( t ) ; t^.pt := (l-1)*n+i; t^.next := ke[(i-1) *n+j];ke[(i-1)*n+j]:=t; end; for l:=j+1 to n do if l <> i then if coke[j,l] = 1 then begin new ( t ) ; t^.pt := (j-1)*n+l; t^.next := ke[(i-1) *n+j];ke[(i-1)*n+j]:=t; end; for l:=1 to j-1 do if l <> i then if coke[j,l] = 1 then begin new ( t ) ; t^.pt := (l-1)*n+j; t^.next := ke[(i-1) *n+j];ke[(i-1)*n+j]:=t; end; end; end; procedure khoitaorec; var i,j,tro : integer ; xau : link ; begin tro:=0; fillchar ( chon ,sizeof(chon) , 0) ; while tro < m do begin for i:=1 to n do for j:=i+1 to n do if (coke[i,j] = 1) and (chon[(i-1)*n+j] = 0) then begin inc (tro); rec[tro]:=(i-1)*n+j ; xau:=ke[(i-1)*n+j] ; while xau <> nil do begin if chon[xau^.pt] = 0 then begin inc (tro ) ; rec[tro] := xau^.pt ; chon[xau^.pt]:=1 ; end ; xau:=xau^.next ; end; end; end; fillchar ( chon ,sizeof(chon) , 0) ; end; procedure pt ( i :integer ) ; var j : integer ; begin sluoc[i]:=0 ; for j:=2 to i do if i mod j = 0 then begin inc (sluoc[i] ) ; uoc^[i,sluoc[i]]:= j ; repeat i:=i div j ; until (i mod j) <> 0 ; if i = 1 then exit ; end; end; procedure khoitaouoc ; var i : integer; begin for i:=1 to m do pt ( i ) ; end; function Look here (+) There is a report of delphi compiler (it used on timus) don't use identifier "TRY" - it is a reserved word. -------------------------------------------------------------- Borland Delphi Version 13.0 Copyright (c) 1983,99 Inprise Corporation 1.PAS(1) 1.PAS(1) 1.PAS(1) 1.PAS(169) Error: Identifier expected but 'TRY' found 1.PAS(169) Error: Procedure cannot have a result type 1.PAS(182) Error: Statement expected, but expression of type 'Integer' found 1.PAS(184) Error: EXCEPT or FINALLY expected 1.PAS(189) Error: Statement expected but 'PROCEDURE' found 1.PAS(197) Error: Statement expected, but expression of type 'Integer' found 1.PAS(198) Error: EXCEPT or FINALLY expected 1.PAS(200) Error: Statement expected but 'PROCEDURE' found 1.PAS(232) -------------------------------------------------------------- |
|
|