|
|
back to boardCrash (stack overflow) ??? Posted by Nuri 19 Nov 2012 18:22 #include <iostream> #include <cmath> #include <iomanip> using namespace std; int main() { int A=140000, i; double a[14000]; for(i=0; cin >> a[i]; i++) { a[i] = sqrt(a[i]); } i--; for( ; i>=0; --i) { cout << fixed; cout << setprecision(4) << a[i] << endl; } return 0; } Re: Crash (stack overflow) ??? Posted by Nuri 20 Nov 2012 02:27 #include <iostream> #include <cmath> #include <iomanip> #include <vector> using namespace std; __int64 li; vector<double> vp; double a[14000]; int i=0; void solve() { for( ; cin >> li; i++) { vp.push_back(sqrt(static_cast<double>(li))); } for(int j=vp.size()-1; j>=0; j--) { cout << fixed; cout << setprecision(4) << vp[j] << endl; } } int main() { solve(); return 0; } |
|
|