| ||||||||||
| 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 | |||||||||
Re:想神牛求教!!!pascal伤不起啊.In Reply To:想神牛求教!!!pascal伤不起啊. Posted by:mnx at 2012-11-04 21:18:10 读入 时时留意,处处小心
pascal 伤不起 附代码
procedure init;
var tmp,i:longint;
ch:char;
begin
readln(m,l);
fillchar(a,sizeof(a),0);
a[m+2]:=-1;
for i:=1 to m-1 do
begin
read(ch);
case ch of
'-':begin read(tmp);a[i]:=-tmp; end;
'+':begin read(tmp);a[i]:=tmp; end;
'L':a[i]:=-100000;
'0':a[i]:=0;
end;
read(ch);
end;
if m<>0 then begin
read(ch);
case ch of
'-':begin read(tmp);a[m]:=-tmp; end;
'+':begin read(tmp);a[m]:=tmp; end;
'L':a[m]:=-100000;
'0':a[m]:=0;
end;
readln;
end;
end;
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator