- 津津的储蓄计划
- 2014-05-14 19:50:49 @
pascal:
var
i,b,m,n:longint;
a:array[0..12] of longint;
begin
for i:=1 to 12 do
readln(a[i]);
i:=0;b:=0;m:=0;
repeat
inc(i);
b:=b+300;
b:=b-a[i];
if b<0 then begin
writeln(-i);
exit;
end else begin
n:=b div 100;
m:=m+n*100;
b:=b-n*100;
end;
until i=12;
if b>=0 then writeln(m*1.2+b:0:0);
end.
0 条评论
目前还没有评论...