Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
那位神牛看看,。为什么会输出格式错误。。var a,b,c,d,e,m,n,sum:longint; s1,s2:ansistring; s:array[0..10000]of char; ch:char; begin readln(n); s1:=''; for a:=1 to n do begin readln(ch); s1:=s1+ch; end; s2:=''; sum:=0; for a:=length(s1) downto 1 do s2:=s2+s1[a]; for a:=1 to n do begin if s1<s2 then begin inc(sum); s[sum]:=s1[1]; delete(s1,1,1); delete(s2,length(s2),1); end else begin inc(sum); s[sum]:=s2[1]; delete(s2,1,1); delete(s1,length(s1),1); end; end; for a:=1 to sum-1 do write(s[a]); writeln(s[sum]); end. Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator