|  | 
|  | 
| back to board | Wrong answer (c++) Posted by Igor  19 Aug 2014 17:35#include<iostream>#include<stack>
 #include<iomanip>
 #include<math.h>
 using namespace std;
 int main()
 {
 stack<int> a;
 int i,n(0),temp;
 while (cin >> temp)
 {
 n++;
 a.push(temp);
 };
 for (i=0;i<n;i++)
 {
 cout << fixed << setprecision(4) << sqrt(double(a.top())) << endl;
 a.pop();
 };
 return 0;
 };
 what is the problem?
 
 Edited by author 19.08.2014 17:38
Re: Wrong answer (c++) Try the sample input on your solution, I think it will fail.
 
 1427  0
 
 876652098643267843
 5276538
 | 
 | 
|