题解
查看原帖
题解
5996
翰浩楼主2015/2/10 15:15
var
  i,c,s:longint;
  fun:boolean;
  mon:array [1..12] of integer;
begin
  for i:=1 to 12 do read(mon[i]);
  for i:=1 to 12 do begin
    s:=s+300-mon[i];
    c:=c+s div 100;
    s:=s mod 100;
    if s<0 then begin
      write('-',i);
      fun:=true;
      exit;
    end;
  end;
  if fun=true then i:=0 else write(s+120*c);
end.

2015/2/10 15:15
加载中...