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

70题留念附pascal 1AC代码

Posted by aiouniya at 2012-08-23 16:50:53 on Problem 1575
var
  a:string;
  len,i,ly,lf:integer;
  yuan,bbb:boolean;
function yes:boolean;
begin
  yes:=false;
  for i:=1 to len do
    begin
      if (a[i]='a')or(a[i]='e')or(a[i]='i')or(a[i]='o')or(a[i]='u')
      then begin yuan:=true;inc(ly);lf:=0;end else begin inc(lf);ly:=0;end;
      if (a[i]=a[i+1])and(a[i]<>'e')and(a[i]<>'o') then exit;
      if (ly>2)or(lf>2) then exit;
    end;
  if yuan then yes:=true;
end;
begin
  readln(a);
  while a<>'end' do
    begin
      yuan:=false;
      len:=length(a);
      ly:=0;
      lf:=0;
      a[len+1]:='@';
      bbb:=yes;
      if bbb
      then writeln('<',a,'> is acceptable.')
      else writeln('<',a,'> is not acceptable.');
      readln(a);
    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