- 津津的储蓄计划
- 2009-05-07 12:58:15 @
var i:integer;
a:array[1..12] of integer;
t,m:integer;
begin
for i := 1 to 12 do
readln(a[i]);
t:=0;
m:=0;
for i := 1 to 12 do
begin
t:=t+300-a[i];
if t=100 then
begin
m:=m+(t div 100)*100;
t:=t-(t div 100)*100;
end;
end;
t:=t+(m*120 div 100);
write(t);
end.
2 条评论
-
qzssy5618 LV 8 @ 2009-05-08 17:46:27
`
\
`\
`\
``续附源码
var
i,s,m,w,f:longint;
a:array[1..12]of integer;
begin
for i:=1 to 12 do
readln(a[i]);
s:=0;
for i:=1 to 12 do
begin
s:=s+300;
s:=s-a[i];
if s -
2009-05-08 17:40:58@
·············
额··这个貌似是简单模拟吧
循环读入的数据,先判断是否会超支,如果会,那么输出,退出程序
如果不会,继续:将剩余的钱+300-a[i](第i个月的开支)
循环完成后再输出总钱数即可·······
没这么麻烦吧,应该1次AC的,尚需努力雅·····
- 1