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

Help ME!WA(C)
Posted by Yanghe 31 Aug 2008 17:45
#include "stdio.h"
#include "math.h"
int main()
{
    float a[32768];
    int i,j=0;
    while(scanf("%f",&a[j])!=EOF)j++;
    for(i=0;i<=j;i++)printf("%.4f\n",sqrt(a[i]));
    return 0;
}
Why??How could I stop it?
Re: Help ME!WA(C)
Posted by nikonoff (ONPU) 22 Sep 2008 18:59
The first: don't use float - need double (you lost precision)
The second: amount of numbers in input can be at most 128*1024 (it is more than 32768)