1 câu trả lời
1/
Program BTH;
uses crt;
var s:real;
i,n:longint;
Begin
clrscr;
write('Nhap n: ');readln(n);
For i:=2 to n do
Begin
If i mod 2=1 then s:=s+1/i;
end;
writeln('Tong day so tren la: ',s:4:2);
readln;
end.
2/
Program BTH;
uses crt;
var s:real;
i,n:longint;
Begin
clrscr;
write('Nhap n: ');readln(n);
For i:=2 to n do
Begin
If i mod 2=0 then s:=s+1/i;
end;
writeln('Tong day so tren la: ',s:4:2);
readln;
end.