#include <iostream> using namespace std; int main() { int n, i, j; cin >> n; int a[n]; for (i = 1; i <= n; i++) for (j = 1, a[i] = 1; j <= i; j++) a[i] *= j; }
Pascal
var a:array[1..1000] of integer; n, i,j:integer; begin read(n); for i:=1 to n do begin a[i]:=1; for j:=1 to i do a[i]:=a[i]*j; end; end.
#include <iostream>
using namespace std;
int main()
{
int n, i, j;
cin >> n;
int a[n];
for (i = 1; i <= n; i++)
for (j = 1, a[i] = 1; j <= i; j++)
a[i] *= j;
}
Pascal
var a:array[1..1000] of integer;
n, i,j:integer;
begin
read(n);
for i:=1 to n do
begin
a[i]:=1;
for j:=1 to i do
a[i]:=a[i]*j;
end;
end.