Ответ:
program pred;
var
n, i, s: Integer;
begin
Write ('Введите N: ');
ReadLn (n);
s := 0;
i := 1;
while i <= n do begin
if i mod 2 = 0 then
s := s + i;
Inc (i);
end;
WriteLn ('Сумма = ', s);
ReadLn;
end.
- - - - - - - - - - - - - -
program post;
repeat
until i > n;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
Ответ:
program pred;
var
n, i, s: Integer;
begin
Write ('Введите N: ');
ReadLn (n);
s := 0;
i := 1;
while i <= n do begin
if i mod 2 = 0 then
s := s + i;
Inc (i);
end;
WriteLn ('Сумма = ', s);
ReadLn;
end.
- - - - - - - - - - - - - -
program post;
var
n, i, s: Integer;
begin
Write ('Введите N: ');
ReadLn (n);
s := 0;
i := 1;
repeat
if i mod 2 = 0 then
s := s + i;
Inc (i);
until i > n;
WriteLn ('Сумма = ', s);
ReadLn;
end.