Program programma;
Uses crt;
var n,p,i: integer;
Begin clrscr;
write('Введите число N = ');
readln(n);
p:=1;
if (n<=12) and (n>0) then begin
write('P=');
for i:=1 to n-1 do
begin
p:=p*i;
write(i,'*');
end;
p:=p*n;
write(n,'=', p);
end;
End.
или проще
Program programma;
Uses crt;
var n,p,i: integer;
Begin clrscr;
write('Введите число N = ');
readln(n);
p:=1;
if (n<=12) and (n>0) then begin
write('P=');
for i:=1 to n do
p:=p*i;
write(p);
end;
End.