KHÁM PHÁ Học Toán + Tiếng Anh theo Sách Giáo Khoa cùng học online và gia sư dạy kèm tại nhà từ lớp 1 đến lớp 12 với giá cực kỳ ưu đãi kèm quà tặng độc quyền"CỰC HOT".
uses crt; var n,i,x,t:longint; s:real; begin clrscr; write(‘x=’);readln(x); while s<10000 do begin t:=1; for i:=1 to n do t:=t*x; s:=s+t; inc(n); end; writeln(‘n= ‘,n-1); writeln(‘s= ‘,s:0:0); readln end.
program tinhtong;
uses crt;
var s,gt:longint;
x,n,i:integer;
begin
clrscr;
write(‘Nhap x: ‘); readln(x);
s:=0; n:=0;
while s<10000 do
begin
gt:=1;
for i:=1 to n do
gt:=gt*x;
s:=s+gt;
n:=n+1;
end;
writeln(‘Tong nho nhat thoa man la: ‘,s);
writeln(‘Va so n nho nhat thoa man la: ‘,n);
readln
end.
uses crt;
var n,i,x,t:longint; s:real;
begin
clrscr;
write(‘x=’);readln(x);
while s<10000 do
begin
t:=1;
for i:=1 to n do t:=t*x;
s:=s+t;
inc(n);
end;
writeln(‘n= ‘,n-1);
writeln(‘s= ‘,s:0:0);
readln
end.