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

Why wa?

Posted by mayakovsky at 2004-10-24 20:14:27 on Problem 1936
program all_in_all;
var m,n,t:string;i,j:integer;k,l:integer;flag:string[3];
begin
readln(t);
l:=pos(' ',t);k:=length(t);
m:=copy(t,1,l-1);
delete(t,1,l);
n:=t;
k:=length(m);
l:=length(n);j:=1;i:=1;
while i<k do
begin
 while (m[i]<>n[j]) do
 begin
 inc(j);
  if j>l then
  begin flag:='No';break;write(i,j)
  end;
 end;
 inc(i);inc(j);
 if j>l then
  begin flag:='No';break;write(i,j)
  end;
if (i=k) and (flag<>'No') then flag:='Yes';
end;{while}
writeln(flag);
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