Код:
var
i, sum: integer;
begin
sum:=0;
for i:=1 to 100 do begin
if i mod 2 <> 0 then begin
write(i,' ');
inc(sum, i);
end;
writeln;
write('Sum =',sum);
end.
Код:
var
i, sum: integer;
begin
sum:=0;
for i:=1 to 100 do begin
if i mod 2 <> 0 then begin
write(i,' ');
inc(sum, i);
end;
end;
writeln;
write('Sum =',sum);
end.