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

need help
Posted by misele 2 Nov 2010 19:54
someone help me, what's wrong with this code?

#include <stdio.h>
#include <math.h>

int main(int argc, char **argv) {
    double nums[131072]; /* 256 * 1024 / 2 */
    int count = 0;

    while (scanf("%lf", nums + count) != EOF)
        count++;

    while (count) {
        count--;
        printf("%.4lf\n", sqrt((double)(nums[count])));
    }

    return 0;
}

AC! thanks no help needed anymore.

Edited by author 02.11.2010 22:08
Re: need help
Posted by INNOV.Team 27 Jan 2011 12:10
Isn't there any "Stack Overflow" error occured? And how can you terminate the input? I have tried "scanf(...)==EOF" and (cin>>...)!=0, but both failed.