1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
uses
crt;
var
i,n: integer;
fact: longint;
begin
readln(n);
if n< 0 then writeln('г”г*гєгіг®г°гёг*г«г* г®гіг°гёг¶г*гігґг«гјг*г®гјг® г·гёг±г«г* г*гґгі')
else if n=0 then writeln('г”г*гєгіг®г°гёг*г«: =',1)
else if n> 0 then
fact: =1;
for i: =1 to n do
fact: =fact*i;
end;
writeln('г”г*гєгіг®г°гёг*г« ',n,': =',fact);
readkey
end.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
uses
crt;
var
i,n: integer;
fact: longint;
begin
readln(n);
if n< 0 then writeln('г”г*гєгіг®г°гёг*г«г* г®гіг°гёг¶г*гігґг«гјг*г®гјг® г·гёг±г«г* г*гґгі')
else if n=0 then writeln('г”г*гєгіг®г°гёг*г«: =',1)
else if n> 0 then
begin
fact: =1;
for i: =1 to n do
begin
fact: =fact*i;
end;
writeln('г”г*гєгіг®г°гёг*г« ',n,': =',fact);
end;
readkey
end.