ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1001. Reverse Root

Stack overflow
Posted by abdujabbor 2 Jul 2012 23:48
I dont know if I use the array with size 131072 I get result "access violation" if I use the size 131073 I get the result "stack overflow" so how I get the right way to resolve the problem, sorry for my bad english;

#include <stdio.h>
#include <math.h>

int main()
{
    int index = -1;
    double stack[131073];
    while(scanf("%lf", &stack[++index]) != EOF);
    for(; top > 0;printf("%.4lf\n", sqrt(stack[--index])));
    return 0;
}
Re: Stack overflow
Posted by Jane 3 Jul 2012 00:09
#include <stdio.h>
#include <math.h>
double stack[131073];
int main()
{
    int index = -1;
    while(scanf("%lf", &stack[++index]) != EOF);
    for(; index > 0;printf("%.4lf\n", sqrt(stack[--index])));
    return 0;
}
Re: Stack overflow
Posted by Coder 25 Nov 2012 21:24
Did you resolve the problem?