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

kc2uno Wrong answer for C [1] // Problem 1001. Reverse Root 30 May 2011 11:23
  1 #include <stdio.h>
  2 #include <stdlib.h>
  3 #include <math.h>
  4
  5 int main()
  6 {
  7     double m=pow(10,18);
  8
  9     long int arr[131072];
 10     int count=0,i;
 11
 12     long int d;
 13     while(scanf("%ld",&d)!=EOF)
 14     {
 15         arr[count++]=d;
 16     }
 17
 18     for(i=count-1;i>=0;i--)
 19     {
 20         double val=(double)arr[i];
 21         printf("%.4f\n",val>m?0:sqrt(val));
 22     }
 23
 24     return 0;
 25 }

I tried it with the input they gave for the example and it worked. Could someone point out what could be wrong with it?
AterLux Re: Wrong answer for C // Problem 1001. Reverse Root 30 May 2011 13:48
why you checking for m ? I think better remove it

printf("%.4f\n" ... try \r\n instead of \n