2 câu trả lời
$\text{program giai_thua;}$
$\text{uses crt;}$
$\text{var i, n, t : longint ;}$
$\text{begin }$
$\text{clrscr;}$
$\text{write('nhap so n : ');readln(n);}$
$\text{t := 1;}$
$\text{for i:= 1 to n do }$
$\text{t:= t*i;}$
$\text{writeln('gia tri cua t la:', t );}$
$\text{readln}$
$\text{end.}$
program ct;
uses crt;
var i,n:integer;
gt:longint;
begin clrscr;
write('Nhap so n: '); readln(n);
gt:=1;
for i:=1 to n do
gt:=gt*i;
writeln(n,' giai thua la: ',gt);
readln;
end.
Câu hỏi trong lớp
Xem thêm