| 
 | 
back to boardWhy??  Memory limit exceeded?? #7 Memory limit exceeded    #7    time = 1.312    Memory used = 20 620 KB. Why memory used too much???? :((     #include <iostream> #include <math.h> #include <iomanip> #include <string> #include <sstream> using namespace std;   string d2s(double x) {     stringstream ii;     ii << fixed << setprecision(4) << x;     return ii.str(); }   int main( ) {     double n;         string s = "";     while ((cin >> n))     {           s = d2s(sqrt(n)) + "\n" + s;     }     cout << s;
      return 0; }  |  
  | 
|