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

WA 3 C++
Posted by the_swede 1 Aug 2011 19:14
Hi,

 can anyone tell me what makes test 3 go wrong with this code, please? I have tried several variants of it but without any success.

#include <iostream>
#include <iomanip>
#include <math.h>

using namespace std;

long double v[256*1024/2];

int main()
{
    long double c;
    cout << setprecision(4) << fixed;
    int j = 0;
    while (1){
        cin >> c;
        if (cin.eof()){break;}
        v[j] = sqrt(c);
        j += 1;
    }

    for (int i = 0; i < j; i++){cout << v[j - 1 - i] << endl;}
}