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

Re:想神牛求教!!!pascal伤不起啊.

Posted by mnx at 2012-11-04 21:48:46 on Problem 1644 and last updated at 2012-11-04 21:50:18
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:
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