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

C++ What's wrong?
Posted by Ilia 28 Oct 2020 20:48
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;

int main()
{
    double val = 0;
    vector<double> v;
    char ch = 0;

    while (cin >> val)
    {
        v.push_back(val);
    }
    for (int i = 0; i < v.size(); i++)
    {
        cout << sqrt(v[i]) << endl;
    }
}
Re: C++ What's wrong?
Posted by MaXX74 29 Oct 2020 01:28
OK. Read this carefully: "For each number Ai from the LAST one till the FIRST one..."
Re: C++ What's wrong?
Posted by Agyn 20 Feb 2022 01:03
Second for loop cout from last element of the vector to first