program bai1;
var s,i,n:longint;
begin
repeat
write('N= ');
readln(n);
until n>0;
s:=0;
for i:=1 to n do
ì i mod 2=1 then s:=s+i;
write('Tong cac so s le la ',s);
redln
end.
KO BIẾT CÓ ĐÚNG KO
uses crt;
var n,i:integer;
begin
clrscr;
write('n='); readln(n);
for i:=1 to n do
begin
if i mod 2=0 then write(i:4);
writeln;
if i mod 2=1 then write(i:4);
end;
readln;
end.
uses crt;
var n,i:integer;
begin
clrscr;
write('n='); readln(n);
for i:=1 to n do
begin
if i mod 2=0 then write(i:4);
writeln;
if i mod 2=1 then write(i:4);
end;
readln;
end.