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

pascal 的注意啊!!!!!!!!!!输入有#9 ,#10 ,#13,空格做分隔,注意判断

Posted by imbeta at 2010-08-25 21:37:06 on Problem 1458
以下是我给出的判断代码,临时写的有点乱,不明白的参考下

readln(s);
  i:=pos(' ',s);

  if i>0 then begin
    while i=1 do
    begin
      delete(s,1,1);
      i:=pos(' ',s);
    end;
    a1:=copy(s,1,i-1);
    delete(s,1,i);
    a2:=s;
    i:=pos(' ',a2);
    while i>0 do
      begin
        delete(a2,i,1);
        i:=pos(' ',a2);
      end;
  end
   else if pos(#9,s)>0 then begin
     i:=pos(#9,s);
     a1:=copy(s,1,i-1);
     delete(s,1,i);
     a2:=s;
     i:=pos(#9,a2);
     while i>0 do
       begin
         delete(a2,i,1);
         i:=pos(#9,a2);
       end;
   end
    else if pos(#10,s)>0 then begin
      i:=pos(#10,s);
      a1:=copy(s,1,i-1);
      delete(s,1,i);
      a2:=s;
      i:=pos(#10,a2);
      while i>0 do
        begin
          delete(a2,i,1);
          i:=pos(#10,a2);
        end;
    end
      else begin
        a1:=s;
        readln(a2);
      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