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

What's wrong with this code?
Posted by Ultra_Satan 16 Dec 2019 04:40
#include <iostream>
#include <iomanip>
#include <cmath>
#include <vector>

using namespace std;

int main() {
    cout << setprecision(4);
    vector<double> v;
    double n;
    while (cin >> n)
        v.push_back(n);
    for (int i = v.size() - 1; i >= 0; i--)
        cout << sqrt(v[i]) << endl;
}
Re: What's wrong with this code?
Posted by ToadMonster 16 Dec 2019 12:50
WA1 typically means your program can't even pass the task example.
Let's see your: https://ideone.com/Y8Uxei - yes, output is wrong.