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++ not pass 2 test
Posted by andrey 27 Feb 2023 20:43
#include <cstdlib>
#include <iomanip>

#include <iostream>

#include <cstdio>
#include <math.h>
#include <vector>
#include <string.h>


#include <algorithm>




using namespace std;
vector <double> numbers = {};

int main(int argc, const char * argv[]) {

    double n;
    while (std::cin >> n)
    {
        numbers.push_back(n);
        if (cin.peek() == '\n' ){
            reverse(numbers.begin(),numbers.end());
            for(int i = 0;i < numbers.size();++i){
                cout<<fixed<<setprecision(4)<<sqrt(numbers[i])<<endl;
            }

            break;
        };
    }

    return 0;
}




I have a correct answer with input numbers in sample, and i see message "wrong answer" in 2 test. First test was passed, but i don't see where i lose...