|
|
back to boardShow all messages Hide all messagestest #9 crash(access violation) double..[65536] ???? who can help me?? oh....it's my code int main(void) { double number,root,temp,answer[65536]; int i=0; while(EOF!=scanf("%lf",&number)) { if(number==0) root=0; else { root=1; temp=(root+number/root)/2; while(root!=temp) { root=temp; temp=(root+number/root)/2; } } answer[i++]=root; } for(i-=1;i>=0;i--) printf("%.4lf\n",answer[i]); return 0; } double number,root,temp,answer[65536]; Size of test is not more than 256 KB. If each number consists from only one digit and there are blank spaces between numbers so no more than 131072 numbers could be in one test, not 65536. |
|
|