|
|
back to boardPlease Help(C++) #include <iostream> #include <vector> #include <cmath> using namespace std; int main() { long long val = 0; vector<double> v; while (cin >> val &&val!=EOF) { v.push_back(sqrt(val)); } for (int i = v.size()-1; i >=0; i--) { cout<< v[i] << endl; } return 0; } Re: Please Help(C++) Set your val type to double Re: Please Help(C++) for (int i = v.size()-1; i >=0; i--) { cout << fixed << setprecision(4) << v[i] << endl; } use this. your program is supposed to print 4 points |
|
|