- 字串变换
- 2009-10-12 23:07:27 @
编译失败...|错误号:1
Prog90702.pas(1,5) Fatal: Syntax error, "identifier" expected but "ordinal const" found Fatal: Compilation aborted
帮忙看下偶的程序,在自己的机子上跑得都好好的
Type Hashtype=Array[0..99991]Of Longint; Ptype=Array[0..10000]Of String;Var C:Array[1..6,1..2]Of String; Hash1,Hash2:Hashtype; P1,P2:Ptype; Dis1,Dis2:Array[0..10000]Of Longint; N:Longint; A,B:String;Procedure Init;Var I:Longint; T:String;Begin Readln(T); A:=Copy(T,1,Pos(' ',T)-1); B:=Copy(T,Pos(' ',T)+1,Length(T)-Pos(' ',T)); While Not Eof Do Begin Readln(T); Inc(N); C[N,1]:=Copy(T,1,Pos(' ',T)-1); C[N,2]:=Copy(T,Pos(' ',T)+1,Length(T)-Pos(' ',T)); End;End;Procedure Print(Ans:Longint);Begin Writeln(Ans); Halt;End;Function ElfHash(S:String):Longint;Var H,G,I:Longint;Begin H:=0; For I:=1 To Length(S) Do Begin H:=H Shl 4 + Ord(S); G:=H And $f0000000; If G0 Then H:=H Xor (G Shr 24); H:=H And (Not G); End; H:=H Mod 99991; Exit(H);End;Function New_Hash(S:String;Var Hash:Hashtype):Longint;Var H:Longint;Begin H:=ElfHash(S); While Hash[H]0 Do Inc(H); Exit(H);End;Function Find_Hash(S:String;Var Hash:Hashtype;Var P:Ptype):Longint;Var H:Longint;Begin H:=ElfHash(S); While (Hash[H]0) And (P[Hash[H]]S) Do Inc(H); If Hash[H]=0 Then Exit(0); Exit(H);End;Procedure Get(Var A,P,Q,B:String;Var Flag:Longint);//Here can be betterVar Po:Longint;Begin Po:=Pos(P,A); If Po=0 Then Begin Flag:=0;Exit;End; Flag:=1; B:=A; Delete(B,Po,Length(P)); Insert(Q,B,Po);End;Procedure Main;Var I,T,Head1,Tail1,Head2,Tail2:Longint; Next1,Next2:String;Begin Fillchar(Hash1,Sizeof(Hash1),0); Fillchar(Hash2,Sizeof(Hash2),0); Fillchar(Dis1,Sizeof(Dis1),0); Fillchar(Dis2,Sizeof(Dis2),0); For I:=1 To 10000 Do Begin P1:=''; P2:=''; End; Head1:=1;Tail1:=1; Head2:=1;Tail2:=1; P1[1]:=A;P2[1]:=B; Hash1[New_Hash(A,Hash1)]:=1;Hash2[New_Hash(B,Hash2)]:=1; While Dis1[Head1]+Dis2[Head2]
2 条评论
-
Little_FS LV 8 @ 2009-10-12 23:15:26
果然……
换了IE就……60分了……
-
2009-10-12 23:12:19@
偶刚刚看了这帖,才发现问题……
估计是chrome的问题…
- 1