|
|
вернуться в форумwhy i get WA on test 7? where is bug? hlp pls {$APPTYPE CONSOLE} Var S,st:AnsiString; i,N,d,MaxLen:Integer; begin Readln(S); N:=length(S); MaxLen:=0; for i:= 1 to N do begin d:=0; while (i>=d)And((N-i)>=d)And(S[i-d]=S[i+d])do Inc(d); if d>MaxLen then begin MaxLen:=d; st:=Copy(S,i-d+1,d*2-1); end; end; writeln(st); end. Re: why i get WA on test 7? where is bug? hlp pls try this string: aooa Re: why i get WA on test 7? where is bug? hlp pls thank you ~i love you very much~~~ |
|
|