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

Crash (stack overflow) 9 why
Posted by Sunnat 17 Apr 2012 01:53
#include<iostream>
#include<math.h>
using namespace std;
void worc(){
   double k;
   if(cin>>k){
     worc();
     printf("%.4lf\n",sqrt(k));
   }
}
int main()
{
   worc();
   return 0;
}
Re: Crash (stack overflow) 9 why
Posted by Dmitri Belous 20 Apr 2012 20:53
Your function calls itself very many times.
Write

#pragma comment(linker, "/STACK:10000000")

And you have got 10 mbytes of memory
accepted
Posted by Sunnat 25 May 2012 19:19
Thank's