a) Program tong1;
uses crt;
var s,i,n: real;
begin
write('nhap n:'); readln(n);
S:=0;
For i:=1 to n do
If i mod 2 =1 then s:=s+i;
writeln('Tong la:', s); readln;
end.
b)
Program tong2;
uses crt;
var s,i,n: real;
begin
write('nhap n:'); readln(n);
S:=0;
For i:=1 to n do
If i mod 2 =0 then s:=s+i;
writeln('Tong la:', s); readln;
end.