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.
uses crt;
var i,n:integer;
s:real;
begin
clrscr;
write('Nhap n='); readln(n);
s:=1;
i:=1;
while i<=n do
begin
s:=s*i;
i:=i+1;
end;
writeln(s:0:0);
readln;
end.
Var i,n,p:longint;
Begin
Write('Nhap n = ');readln(n);
i:=1;
p:=1;
While i<=n do
Begin
i:=i+1;
p:=p*i;
End;
Write('Tich la ',p);
Readln;
End.
uses crt;
var i,n,s:integer;
begin
clrscr;
readln(n);
s:=0;
i:=0;
while i<=n do
begin
i:=i+1;
s:=s+i*i;
end;
writeln(s);
readln;
end.
program TongN;
var
n, i, tong: integer;
begin
tong := 0;
writeln('Nhap so nguyen duong N: ');
readln(n);
i := 0;
while i < n do
begin
i := i + 1;
tong := tong + i;
end;
writeln('Tong cac so tu 1 den ', n, ' la ', tong);
readln;
end.
program DemSoChiaHetCho5;
var
n, i, count: integer;
begin
write('Nhap n: ');
readln(n);
i := 1;
count := 0;
while i <= n do
begin
if i mod 5 = 0 then
count := count + 1;
i := i + 1;
end;
writeln('Co ', count, ' so tu nhien chia het cho 5 trong khoang tu 1 den ', n);
end.
uses crt;
var n,i,t,x:integer;
begin
clrscr;
readln(n);
t:=0;
while n>0 do
begin
x:=n mod 10;
if x mod 2=0 then t:=t+x;
n:=n div 10;
end;
writeln(t);
readln;
end.
uses crt;
var a:array[1..100]of integer;
i,n,t:integer;
begin
clrscr;
write('nhap n='); readln(n);
for i:=1 to n do
begin
write('A[',i,']='); readln(a[i]);
end;
t:=0;
i:=1;
while i<=n do
begin
t:=t+a[i];
inc(i);
end;
writeln(t/n:4:2);
readln;
end.
var i,n,s:integer;
begin
write('nhap n = ');readln(n);
i:=1;
while i<=n do
begin
s:=s+i;
i:=i+1;
end;
write('Tong la ',s);
readln;
end.