|
|
вернуться в форумCrash??? Please, tell me, why I get access violation?? It's my code: {$apptype console} var i,n,x,k,z:integer; s:ansistring; a:array[-10000..2000001]of boolean; t:array[1..6]of string; function correct(i,j:integer):boolean; begin result:=true; for z:=1 to length(t[j]) do if s[i+z]<>t[j,z] then begin result:=false; exit; end; end; procedure test; var i,j:integer; begin fillchar(a,sizeof(a),false); a[0]:=true; for i:=1 to length(s) do for j:=1 to 6 do if a[i-length(t[j])] then if correct(i-length(t[j]),j) then a[i]:=true; end; begin readln(n); t[1]:='one'; t[2]:='out'; t[3]:='output'; t[4]:='puton'; t[5]:='in'; t[6]:='input'; for i:=1 to n do begin readln(s); test; if a[length(s)] then writeln('YES') else writeln('NO'); end; end. I can't understand. Maybe some hint? Edited by author 06.04.2007 09:56 Re: Crash??? string can be more 2*10^6 I think.. |
|
|