|
|
back to boardC++ 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... |
|
|