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.
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(s);
readln;
end.
var i,n,s:integer;
begin
write('nhap n = ');readln(n);
i:=1;
while i<=n do
begin
s:=s+i;
i:=i+1;
end;
write('Tong la ',s);
readln;
end.
Program HOC24;
var i,n: integer;
S: longint;
begin
write('Nhap N: '); readln(n);
i:=1; s:=0;
while i<=n do
begin
s:=s+i;
i:=i+2;
end;
write('S=',S);
readln
end.
program tinh_tong_S;
var
n, i, S: integer;
begin
write('Nhap n: ');
readln(n);
S := 0;
i := 1;
while i <= n do
begin
S := S + i;
i := i + 2;
end;
writeln('Tong S la: ', S);
readln;
end.
uses crt;
var i,n,s:integer;
begin
clrscr;
readln(n);
s:=0;
i:=0;
while i<=n do
begin
i:=i+1;
s:=s+i*i;
end;
writeln(s);
readln;
end.
program tinhtong;
var n,i : integer;
S : real;
begin
write('Nhap n: ');
readln(n);
i:=1;
S:=0;
while i<=n do
begin
S:=S+1/i;
i:=i+1;
end;
writeln('Tong S= ',S);
readln;
end.
program tinh_tong_S;
var
n, i: integer;
S: real;
begin
write('Nhap n: ');
readln(n);
S := 0;
i := 1;
while i <= n do
begin
S := S + 1 / i;
i := i + 1;
end;
writeln('Tong S la: ', S:0:2);
readln;
end.
*while..do
Program HOC24;
var i,n: integer;
s: real;
begin
write('Nhap n: '); readln(n);
i:=1;
while i<=n do
begin
s:=s+1/sqr(i);
i:=i+1;
end;
write('S= ',s:6:2);
readln
end.
program DemSoChiaHetCho5;
var
n, i, count: integer;
begin
write('Nhap n: ');
readln(n);
i := 1;
count := 0;
while i <= n do
begin
if i mod 5 = 0 then
count := count + 1;
i := i + 1;
end;
writeln('Co ', count, ' so tu nhien chia het cho 5 trong khoang tu 1 den ', n);
end.
var i,n,s:longint;
begin
read(n); if n<2 then break;
for i:=3 to n do s:=s+i;
write(s);
end.
Var i,n:integer;
t:longint;
Begin
Write('n = ');readln(n);
i:=2;
While i<=n do
Begin
t:=t+i;
i:=i+1;
End;
Write('Tong la ',t);
Readln
End.
uses crt;
var s:real;
n,i:integer;
begin
clrscr;
write('Nhap n='); readln(n);
s:=0;
i:=1;
while i<=n do
begin
s:=s+1/i;
i:=i+2;
end;
writeln('S=',s:4:2);
readln;
end.
Sao s:4:2 vậy?