|
|
back to boardWhat's wrong with this code? #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? WA1 typically means your program can't even pass the task example. Let's see your: https://ideone.com/Y8Uxei - yes, output is wrong. |
|
|