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

暴力啊 ....

Posted by wy54224 at 2011-01-25 16:43:03 on Problem 3981
program poj3981;
var s,s2:string;
    c1,c2,c3:char;
    i:integer;
begin
 readln(s);
 s:=s+'  ';
 while s<>'  'do
 begin
  s2:='';
  for i:=1 to length(s)-1 do
  begin
   c1:=s[i];c2:=s[i+1];c3:=s[i+2];
   if (c1='y')and(i<=length(s)-2)and(c2='o')and(c3='u')and(s<>'EOF') then
   s2:=s2+'w'
else if (c1='o')and(i<=length(s)-1)and(s[i-1]='y')and(c2='u')and(s<>'EOF')then
s2:=s2+'e'
else if (c1='u')and(i<=length(s))and(s[i-2]='y')and(s[i-1]='o')and(s<>'EOF')then
s2:=s2
else if s<>'EOF' then s2:=s2+c1;
  end;
  delete(s2,length(s2),1);
  writeln(s2);
  readln(s);
  s:=s+'  ';
 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