|
|
вернуться в форумIn what a mistake? type kir=array[1..10000] of char; var m:kir; y,u,t,e,q,i,w:longint; r,ch:char; f2,f1:text; begin assign(f1,'input.txt'); reset(f1); i:=0; read(f1,r); while r in ['a'..'z','A'..'Z','0'..'9'] do begin inc(i); m[i]:=r; read(f1,r); end; close(f1); q:=i; w:=q div 2; for i:=q-1 downto w do begin u:=0; for e:=1 to q-i do begin if m[i-e]=m[i+e] then inc(u) else break; end; if (u>t) and (e=q-i) then begin t:=u;y:=i;end; end; if t<>0 then begin u:=y-t-1; for i:=1 to u do m[q+i]:=m[u-i+1]; q:=q+u; end else begin for i:=1 to q do m[q+i-1]:=m[q-i+1]; q:=q*2-1; end; i:=1; assign(f2,'output.txt'); rewrite(f2); while i<=q do begin write(f2,m[i]); inc(i); end; close(f2); end. Re: In what a mistake? Не надо использовать : assign(f2,'output.txt'); rewrite(f2); и тому подобное. И потом мне кажется тест вида AAA не пройдет!!!. Re: In what a mistake? And It seems to me is not necessary to write in Russian. |
|
|