#include <stdio.h>
#include <stdlib.h>
#include "liss_bool.h"
#include "liss_list.h"
#include "liss_set.h"

int factorial(int n)
{
	int res = 1;

	while (n > 0)
	{
		res = res * n;
		n = n - 1;
	}

	return res;
}

int * calculate(int *a)
{
	int * liss0 = malloc(sizeof(int) * 5);
	int fac = 6;
	int m[5] = {0};
	int liss1 = 0;

	for((*a)=0; (*a)<=3; (*a)+=1)
	{
		m[(*a)] = factorial(fac + (*a));
	}

	m[4] = 444;

	for(liss1=0; liss1<5; liss1++)
		liss0[liss1] = m[liss1];
	return liss0;
}

void writeSeqArray(int z[5])
{
	int liss0 = 0;

	printf("[");
	for(liss0=0; liss0<5; liss0++)
	{
		if (liss0==4)
			printf("%d", z[liss0]);
		else
			printf("%d,", z[liss0]);
	}
	printf("]");
	printf("\n");

}

void main()
{
	int a = 4, b = 5, c = 5;
	int array1[5] = {10,20,30,40}, array2[5] = {0}, array3[5] = {0};
	int liss0 = 0;

	for(liss0=0; liss0<5; liss0++)
		array2[liss0] = calculate(&a)[liss0];

	writeSeqArray(array2);

}
