A acm problem. What's wrong in my code?
<p>The text of problem:</p>

<p><strong>Input</strong>: The input stream contains a set of integer numbers Ai (0 ≤ Ai ≤ 1018). The numbers are separated by any number of spaces and line breaks. A size of the input stream does not exceed 256 KB.</p>

<p><strong>Output</strong>: For each number Ai from the last one till the first one you should output its square root. Each square root should be printed in a separate line with at least four digits after decimal point.</p>

<p><strong>Sample</strong><br>
input:<pre>
 1427  0   </p>

<p>876652098643267843 
5276538</pre></p>

<p>output:<pre>
2297.0716
936297014.1164
0.0000
37.7757</pre></p>

<p>Time Limit: 2.0 second<br>
Memory Limit: 16 MB</p>

<p>C and C++ programs are compiled on the server by the 32-bit Microsoft Visual C++ 2010. Until August 3, 2010 Intel C++ Compiler 7.0 was used. You can download a free copy of Microsoft Visual Studio 2010 Express on this page. The compiler is invoked with the following parameters:</p>

<pre>// C
cl /TC /MT /EHsc /O2 /W3 /Za /D "_CRT_SECURE_NO_WARNINGS" 
   /D "_CRT_SECURE_NO_DEPRECATE" /D "ONLINE_JUDGE"

// C++
cl /TP /MT /EHsc /O2 /W3 /Za /D "_CRT_SECURE_NO_WARNINGS" 
   /D "_CRT_SECURE_NO_DEPRECATE" /D "ONLINE_JUDGE"</pre>

<p>This is my solution of this problem in gcc 4.3:</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;list&gt;
#include &lt;string&gt;
#include &lt;sstream&gt;
#include &lt;math.h&gt;
#include &lt;algorithm&gt;
#include &lt;iomanip&gt;
#include &lt;stdio.h&gt;

void sqrt_f(double n)
{
    printf ( "%.4f\n", sqrt( static_cast&lt;double&gt;( n ) ) );
}

int main()
{
    std::list&lt;double&gt; numbers;
    std::string sInput;
    getline( std::cin, sInput );
    std::istringstream parse( sInput );
    double tmp;
    while ( parse &gt;&gt; tmp )
        numbers.push_front( tmp );
    std::for_each(numbers.begin(), numbers.end(), sqrt_f);
    return 0;
}
</code></pre>

<p>But Judgement result is: wrong answer (test1)</p>

<p>What's the problem?</p>
