Ответ:
program summa;
var sum, i, n:LongInt;
begin
ReadLn(n);
i:=1;
sum := 0;
while (i<=n) do
sum:=sum+i;
i:=i+1;
end;
WriteLn(sum);
end.
===== PascalABC.NET =====
var n := ReadInteger('n =');
var (i, s) := (1, 0);
while i <= n do
s += i;
i += 1
Print(s);
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
program summa;
var sum, i, n:LongInt;
begin
ReadLn(n);
i:=1;
sum := 0;
while (i<=n) do
begin
sum:=sum+i;
i:=i+1;
end;
WriteLn(sum);
end.
===== PascalABC.NET =====
begin
var n := ReadInteger('n =');
var (i, s) := (1, 0);
while i <= n do
begin
s += i;
i += 1
end;
Print(s);
end.