ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1001. Reverse Root

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++)
Posted by Gazeekoo 14 Sep 2014 20:43
Try the sample input on your solution, I think it will fail.


 1427  0

   876652098643267843
5276538