| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
pascal 的注意啊!!!!!!!!!!输入有#9 ,#10 ,#13,空格做分隔,注意判断以下是我给出的判断代码,临时写的有点乱,不明白的参考下
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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator