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 llllljjjjj at 2008-07-25 19:32:16 on Problem 2403
program p2403;
var
  i,j,n,sum,m:longint;
  s:array[1..1000] of string;
  a:array[1..1000] of longint;
  t:ansistring;
  c:char;
begin
  readln(m,n);
  for i:=1 to m do
    begin
      t:='';
      read(c);
      while c<>' ' do
        begin
          t:=t+c;
          read(c);
        end;
      s[i]:=t;
      readln(a[i]);
    end;
  for i:=1 to n do
    begin
       sum:=0;
       readln(t);
       while t<>'.' do
         begin
           for j:=1 to m do
              while pos(s[j],t)<>0 do
                 begin
                   inc(sum,a[j]);
                   delete(t,pos(s[j],t),length(s[j]));
                 end;
           readln(t);
         end;
      writeln(sum);
    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