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

晕,这一题要完全保证输出的前后没有空格,不然PE郁闷死...

Posted by wrong123 at 2005-12-23 03:13:59 on Problem 1951
In Reply To:Why I got PE all the time? Could someone look over my code? Posted by:dfg at 2005-06-21 17:41:03
> const   yy              :set of char=['A','E','I','O','U'];
> var     q,a             :string;
>         i               :longint;
> 
> begin
>         readln(q);
>         while q[1]=' ' do delete(q,1,1);
>         while q[length(q)]=' ' do delete(q,length(q),1);
>         a:='';
>         for i:=1 to length(q) do
>                 case q[i] of
>                         ' ':if a[length(a)]<>' ' then a:=a+' ';
>                         '.',',','?':if a[length(a)]=' ' then a[length(A)]:=q[i] else a:=a+q[i];
>                         else if not (q[i] in yy) and (pos(q[i],a)=0) then a:=a+q[i];
>                 end;
>         writeln(a);
> 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