|
|
back to boardCrash(Access Violation)--What's wrong? Posted by WXuan 23 Mar 2008 14:47 #include<stdio.h> #include<stdlib.h> #include<math.h> #define max 32768 int main() { int i,count; double input[max+1]; for(i=0;i<=max;i++) input[i]=0; count=0; while(scanf("%lf",&input[count])!=EOF)//read the data count++; for(i=count-1;i>=0;i--) { double root; root=exp(log(input[i])/2); printf("%.4lf\n",root); } return 0; } Re: Crash(Access Violation)--What's wrong? Posted by awpris 23 Mar 2008 15:25 int => int64 max => 10000000 Re: Crash(Access Violation)--What's wrong? Posted by WXuan 24 Mar 2008 10:22 Crash again. the max value I can give to max is 100000. Why? Re: Crash(Access Violation)--What's wrong? Попробуй сосчитать логарифм нуля :) |
|
|