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

100题,留言飘过~~

Posted by 94bluef1 at 2010-11-10 14:54:49 on Problem 1936
代码:
var c,t:ansistring;

procedure cin(var s1:ansistring);
var mid:char;
begin
  s1:='';
  read(mid);
  while (mid<>' ')and(ord(mid)<>10)do begin
    s1:=s1+mid;
    read(mid);
  end;
end;

function judge(ss,tt:ansistring):boolean;
var i,j,mid:longint;
begin
  i:=1;
  mid:=length(ss);
  for j:=1 to length(tt) do begin
    if tt[j]=ss[i] then begin
      inc(i);
      if i=mid+1 then break;
    end;
  end;
  if i=mid+1 then exit(true) else exit(false);
end;

begin
  while not eof do begin
    c:='';
    t:='';
    cin(c);
    cin(t);
    if (ord(c[1])=13)or(ord(c[1])=15)or(ord(c[1])=10) then halt;
   if judge(c,t) then writeln('Yes') else writeln('No');
  end;
end.

第一百题了,什么时候才有500题啊...

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