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.
program tim_n;
uses crt;
var tong,n,i:word;
begin
clrscr;
n:=1;tong:=0;
while tong<500 do
begin
for i:=1 to n do tong:=tong+i;
if tong<500 then begin tong:=0;n:=n+1;end
else n:=n-1;
end;
write('so n thoa man dieu kien la:',n);
readln;
end.
uses crt;
var i,n,t:integer;
begin
clrscr;
write('Nhap n='); readln(n);
t:=0;
for i:=1 to 500 do
begin
t:=t+i;
if t>500 then
begin
writeln(i);
break;
end;
end;
readln;
end.
Var i,s:integer;
Begin
i:=0;
While s<=1000 do
Begin
i:=i+1;
s:=s+i;
End;
Write('n nho nhat la ',i);
Readln;
End.
program TongSn;
var
N, S: integer;
begin
S := 0;
N := 1;
while S <= 1000 do
begin
S := S + N;
N := N + 1;
end;
writeln('So tu nhien can cong de tong Sn vuot qua 1000 la: ', N-1);
writeln('Tong S', N-1, ' la: ', S);
end.
câu 1:
uses crt;
var p,i:integer;
begin
clrscr;
p:=1;i:=1;while i<=5 do
begin
p:=p*i;i:=i+1;
end;
write(p);
readln;
end.
bai 2:
uses crt;var p,i:integer;begin clrscr; p:=1; i:=0; while i <=10 do begin
i:=i+1; if (i mod 2<>0) then p:=p*i; end; write(p); readln;end. bai 3:
uses crt;var n,i,p:integer;begin clrscr; write('nhap n: '); readln(n); i:=1; p:=1; while i<=n do begin if i mod 2=0 then p:=p*i; i:=i+1; end; write(p); readln;end.
uses crt;
var i,t:integer;
begin
clrscr;
t:=0;
for i:=1 to 1000 do
if (i mod 10=5) and (i mod 2=1) then t:=t+i;
writeln(t);
readln;
end.
Program HOC24;
var i,n,t: integer;
begin
n:=1; t:=0;
while t<=20 do
begin
t:=t+n;
n:=n+1;
end;
writeln('Tong la: ',t);
readln
end.
uses crt;
var i,n,t:integer;
begin
clrscr;
t:=0;
for i:=1 to 20 do
t:=t+i;
if t>20 then
begin
writeln(t);
break;
end;
readln;
end.
uses crt;
var t,n:integer;
begin
clrscr;
t:=0;
n:=0;
while t<=10 do
begin
n:=n+1;
t:=t+n;
end;
writeln(t);
readln;
end.
Var s,i:integer;
Begin
s:=0;
i:=0;
While S<1000 do
Begin
i:=i+1;
s:=s+i;
End;
Write('n la ',i);
Readln;
End.
uses crt;
var n,i,t:integer;
begin
n:=0;
t:=0;
repeat
n:=n+2;
t:=t+n;
until t>69;
writeln(n);
writeln(t);
readln;
end.
-------------------
Program Tinh_Tong;
Var i:Word;
S:Longint;
Begin
S:=0;
For i:=1 to 1000 do S:=S+i;
Write('Tong S=',S);
Readln;
End.
---------------------
Program Tinh_Tong;
Var i:Word;
S:Longint;
Begin
S:=0;
For i:=1 to 1000 do S:=S+i;
Write('Tong S=',S);
Readln;
End.