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 |
虽然写的难看,也不至于WA啊。。。var n,i,len,sum,j:longint; s,t:string; ans:array[1..1000]of string; begin readln(n); for i:=1 to n do begin readln(s); len:=length(s); for j:=1 to len do if s[i]=' ' then delete(s,i,1); len:=length(s); j:=1; while j<=len do begin sum:=1; while s[j]=s[j+1] do begin inc(sum); inc(j); end; str(sum,t); ans[i]:=ans[i]+t+s[j]; inc(j); end; writeln(ans[i]); end; end. Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator