Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

虽然写的难看,也不至于WA啊。。。

Posted by Alex_Wong93 at 2010-09-22 14:32:29 on Problem 3438
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator