Ответ:
program Moneybox;
var
months, a, b: integer;
procedure moneybox(months: integer; a: integer; b: integer);
i, amount: integer;
begin
i:= 1;
amount:= 0;
while i <= months do begin
amount:= amount + a;
a:= a + b;
i:= i + 1;
end;
write('money in moneybox: ');
writeln(amount);
writeln('input a: ');
readln(a);
writeln('input b: ');
readln(b);
writeln('input quantity of months: ');
readln(months);
moneybox(months, a, b);
end.
Объяснение:
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
program Moneybox;
var
months, a, b: integer;
procedure moneybox(months: integer; a: integer; b: integer);
var
i, amount: integer;
begin
i:= 1;
amount:= 0;
while i <= months do begin
amount:= amount + a;
a:= a + b;
i:= i + 1;
end;
write('money in moneybox: ');
writeln(amount);
end;
begin
writeln('input a: ');
readln(a);
writeln('input b: ');
readln(b);
writeln('input quantity of months: ');
readln(months);
moneybox(months, a, b);
end.
Объяснение: