Viết chương trình 1+2+3+...+1/t. Hôm nay cô cho bài này để ôn mai tớ thi r
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 tinh_toan;
uses crt;
var S;i:integer;
begin
S:=0;
for i:=2 to 100 do S:=S+1/i;
writeln(S);
readln;
end.
Var i,n:integer;
s:real;
Begin
Write('n = ');readln(n);
For i:=2 to n do s:=s+1/i;
Write('tong la ',s:10:2);
Readln;
End.
uses crt;
var i,n,t:integer;
begin
clrscr;
readln(n);
t:=0;
for i:=1 to n do if i mod 2=1 then t:=t+i;
writeln(t);
readln;
end.
tham khảo
uses crt;
var i,t:integer;
begin
clrscr;
t:=0;
for i:=1 to 10 do
t:=t+i;
writeln('Tong cac so tu nhien tu 1 toi 10 la: ',t);
readln;
end.
refer
uses crt;
var i: integer;
begin
clrscr;
for i:= 1 to 10 do
begin writeln ( ' O ' ) end;
readln
end.
Good morning ! Welcome to the weather forecast. Let's take a look at the weather today and tomorrow. Today, it's cool and sunny in Ha Noi. What will the weather be tomorrow ? Well, it will be hot and sunny. This is the weather forecast of today and tomorrow. The program is coming to an end. Please watch the show tomorrow. Have a nice day. Good bye !
Good morning ! We will come to weather forecasts today and tomorrow .Today in Hanoi it's cool and sunny. What will tomorrow be? Watch ! Tomorrow in Hanoi it's hot and sunny .This is the weather forecast today and tomorrow . The weather forecast program here comes to end . Please watch the show tomorrow. Have a nice day ! Goodbye .
uses crt;
var i,s:longint;
begin
clrscr;
s:=1;
for i:=1 to 10 do
s:=s*i;
writeln(s);
readln;
end.
tham khảo
Program chuong_trinh_tinh_tong;
User crt;
var n,i:integer;
S:real;
begin;
write('nhap n = ');
readln(n);
s:=0;
for i :=1 to n do S :=S + 1/i;
writeln('tong S = ',S:5:2);
readln
end.
tham khảo
Program chuong_trinh_tinh_tong;
User crt;
var n,i:integer;
S:real;
begin;
write('nhap n = ');
readln(n);
s:=0;
for i :=1 to n do S :=S + 1/i;
writeln('tong S = ',S:5:2);
readln
end.