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 TinhTongTich;
var
N, i, Tong, Tich:integer;
begin
writeln('Nhap so nguyen duong N:');
readln(N);
i:=1;
Tong:=0;
Tich:=1;
while i<=N do
begin
Tong:=Tong+i;
Tich:=Tich*i;
i:=i+1;
end;
writeln('Tong cac so tu 1 den ', N, ' la: ', Tong);
writeln('Tich cac so tu 1 den ', N, ' la: ', Tich);
readln;
end.
var s, i: real;
begin
s := 0;
for i := 1 to 50 do
s := s + 1/i;
writeln('Tong s = ', s:0:2);
end.
Var i:integer;
s:real;
Begin
For i:=1 to 50 do
s:=s + 1/i;
Write('Tong la ',s:10:2);
Readln;
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.
For...do:
var s,i: integer;
begin
readln(s,i);
s:=0;
For i:=3 to 99 do
If i mod 3 = 0 do s:=s+i;
write(s)
readln;
end.
while ... do:
Var i,S:integer;
Begin
Readln(i,s);
S:=0;
i:=3;
while i<=99 do
if i mod 3 = 0 then s:=s+i;
write(s);
Readln;
End.
#include <bits/stdc++.h>
using namespace std;
long long i,t;
int main()
{
t=0;
for (i=1;i<=100;i++)
t=t+i;
cout<<t;
return 0;
}
program tinh_tong;
uses crt;
var i,n:integer;
s:real;
begin
clrscr;
write('nhap n:');readln(n);
for i:=1 to n*2-1 do
if i mod 2=1 then s:=s+1/i;
writeln('tong la: ',s);
readln;
end.
program tinh_tong;
uses crt;
var i,n:integer;
s:real;
begin
clrscr;
write('nhap n:');readln(n);
i:=1;
while i<=n*2-1 do
begin
s:=s+1/i;
i:=i+2;
end;
writeln('tong la: ',s);
readln;
end.
Program Tinh_tong;
Uses Crt;
Var i, S: Integer;
Begin
Clrscr;
S:=0; i:=1;
While S>=100 do
Begin
S:=S+i;
i:=i+1;
End;
Writeln('Ket qua',S);
Readln;
End.