There is no need to use dinamic memory ...
Just make sure that your array is large enough.
But I wonder why the result I get is TLE ...
this is my code:
#include<stdio.h>
#include<string.h>
#include<math.h>
double a[100010];//make it larger and then I got AC
int main()
{
int k=0;
while(scanf("%lf",&a[k])!=EOF)k++;
while(k)
printf("%.4lf\n",sqrt(a[--k]));
return 0;
}
use dinamic memory try
double *a = (double *) malloc (sizeof(double)*128*1024);
and when you done before return
free (a);
thats all :)