![](https://rs.olm.vn/images/avt/0.png?1311)
Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.
![](https://rs.olm.vn/images/avt/0.png?1311)
![](https://rs.olm.vn/images/avt/0.png?1311)
program TinhTong;
var
i, S: integer;
begin
S := 0;
for i := 1 to 10 do
S := S + i;
writeln('Tong cac so tu 1 den 10 la: ', S);
readln;
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
a: uses crt;
var i,n:integer;
s:real;
begin
clrscr;
s:=0;
for i:=1 to 100 do s:=s+1/i;
writeln(s:4:2);
readln;
end.
b:
uses crt;
var i,n:integer;
s:real;
begin
clrscr;
s:=0;
i:=0;
while i<=100 do
begin
inc(i);
s:=s+1/i;
end;
writeln(s:4:2);
readln;
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
uses crt;
var a,t,i:integer;
begin
clrscr;
t:=0;
for i:=1 to 6 do
begin
readln(a);
if (a mod 2=0) then t:=t+a;
end;
writeln(t);
readln;
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
Bài 1:
uses crt;
var n,i,s:integer;
begin
clrscr;
write('Nhap n='); readln(n);
s:=0;
i:=1;
while i<=n do
begin
s:=s+i;
inc(i);
end;
writeln('Tong cac so trong khoang tu 1 den ',n,' la: ',s);
readln;
end.
Bài 2:
uses crt;
var n,i,s:integer;
begin
clrscr;
write('Nhap n='); readln(n);
s:=0;
i:=1;
while i<=n do
begin
s:=s+i;
i:=i+2;
end;
writeln('Tong cac so le trong khoang tu 1 den ',n,' la: ',s);
readln;
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
uses crt;
var i,t:integer;
begin
clrscr;
t:=0;
for i:=1 to 100 do t:=t+i;
writeln(t);
readln;
end.
![](https://rs.olm.vn/images/avt/0.png?1311)
uses crt;
var i,t:integer;
begin
clrscr;
t:=0;
for i:=1 to 100 do t:=t+i;
writeln(t);
readln;
end.
Bài toán cổ nào vậy bạn?