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.
Tham khảo:
Uses Crt ;
Var i , n : Integer ;
tong: Real ;
BEGIN
Clrscr ;
Write (‘ Cho so tu nhien n : ‘) ; Readln (n) ;
tong :=0 ;
i :=1 ;
While i <= n Do
Begin
tong := tong + 1/i ;
i := i + 1 ;
End ;
Writeln (‘ Tong can tim la : ‘, tong:12:6 ) ;
Readln ;
END .
uses crt;
var i,n:integer;
s:longint;
begin
clrscr;
write('nhap n:');readln(n);
s:=0;
for i:=1 to n do
if i mod 2=1 then s:=s+i
else s:=s-i;
writeln('s= ',s);
readln;
end.
a) uses crt;
var n,x,i:longint;
lt:real;
begin
clrscr;
write('Nhap co so n=');readln(n);
write('Nhap so mu x='); readln(x);
lt:=1;
for i:=1 to x do
lt:=lt*n;
writeln(n,'^',x,'=',lt:0:0);
readln;
end.
Câu 1:
uses crt;
var i,n,t:integer;
begin
clrscr;
readln(n);
t:=0;
for i:=1 to n do
t:=t+i;
writeln(t);
readln;
end.
uses crt;
var s:real;
i,n:integer;
begin
clrscr;
readln(n);
s:=0;
for i:=1 to n do
s:=s+1/(i*(i+2));
writeln(s:4:2);
readln;
end.
var i,n: integer;
s:real;
begin
write(‘Nhập n: ‘); readln(n);
i:=1;
repeat
s:=s+1/i;
i:=i+1;
until i=n;
write(‘s =‘, s:0:4);
readln
end.
diepbich 016/08/2021 at 03:53Reply
Program Hotboy ;
Uses crt;
Var n,i,s : real;
Begin
Writeln(‘nhap n’); readln(n);
Repeat
S:=S+ 1/i;
I:=i+1 ;
Until n=i;
Writeln(‘S=’,S);
Readln
End.
Uses Crt;
Var i,S,n:integer;
Begin
Clrscr;
Readln(i,S,n);
For i:=1 to n do S:=S+i*i;
Write(S);
Readln
End.
uses crt;
var s,i,n:longint;
begin
clrscr;
readln(n);
s:=0;
i:=1;
while i<=n do
begin
s:=s+i*i;
i:=i+1;
end;
writeln(s);
readln;
end.
uses crt;
var i,n,s:integer;
begin
clrscr;
readln(n);
s:=0;
for i:=1 to n do s:=s+i;
writeln(s);
readln;
end.