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!!!!!)why wrong answer
Posted by jixilong 25 Jun 2011 22:58
#include <iostream>
#include<iomanip>
#include <cmath>
double a[131072];
using namespace std;
int main()
{
    double num;

    int i=0;
    while(!cin.eof())
    {
        cin>>a[i];
        a[i]=sqrt(a[i]);
        i++;
    }
    for(int j=i-2;j>=0;j--)
    {
        cout<<fixed<<setprecision(4)<<a[j]<<endl;
    }

    return 0;
}
Re: (help!!!!!)why wrong answer
Posted by hatred 9 Jul 2011 21:42
why u init j with i-2? it must be i-1