|
|
back to boardWhy wrong answer?, please help!! #include <iostream> #include <vector> #include <cmath> using namespace std; int main() { double n; vector<double> v; int a = 1; while (a==1) { cin >> n; v.push_back(n); if (cin.peek() == '\n') a = 0; }
for (int i = 0; i <= v.size() - 1; i++) { //cout << sqrt(v[v.size() - 1 - i]) << endl; printf("%.4f\n", sqrt(v[v.size() - 1 - i]));
} cout << endl;
} Re: Why wrong answer?, please help!! out of type. for ex. 876652098643267843 out of double |
|
|