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(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?
Posted by omsu_lime 10 Apr 2008 10:50
Попробуй сосчитать логарифм нуля :)