Program l;
var
i, n, s: integer;
begin
writeln('Введите n');
readln(n);
for i = 20 to n do begin
if (i mod 2 <> 0) then
s := s + i;
end;
write(s);
end.
Program l;
var
i, n, s: integer;
begin
writeln('Введите n');
readln(n);
for i = 20 to n do begin
if (i mod 2 <> 0) then
s := s + i;
end;
write(s);
end.
i,n,s:integer;
begin
Write('n=');
Readln(n);
s:=0;
for i:=20 to n do
if Odd(i) then s:=s+i;
Writeln('Сумма с for = ',s);
s:=0; i:=21;
while i<=n do
begin
s:=s+i;
i:=i+2
end;
Writeln('Сумма с while = ',s)
end.