Memory limit exceeded
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#define DOUBLES_NUM 64
#define int64 long long
typedef struct list
{
long double nums[DOUBLES_NUM];
struct list *prev;
} list;
int main()
{
unsigned char ind = 0;
unsigned int64 temp;
list *temppl, *pl = malloc(sizeof(list));
pl->prev = NULL;
while(scanf("%I64", &temp) != EOF)
{
pl->nums[ind] = sqrt((long double) temp);
if(++ind >= DOUBLES_NUM - 1)
{
temppl = malloc(sizeof(list));
temppl->prev = pl;
pl = temppl;
ind = 0;
}
}
while(1)
{
while(ind--)
printf("%.4Lf\n", pl->nums[ind]);
if(pl->prev == NULL)
{
free(pl);
break;
}
temppl = pl->prev;
free(pl);
pl = temppl;
ind = DOUBLES_NUM;
}
return 0;
}
Why?