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

what's wrong with it?
Posted by JollyRoger 31 Jan 2015 19:52
#include<iostream>
#include<stack>
#include<math.h>
#include<iomanip>

float next_value = 0;
std::stack<float> my_stack;

int main()
{
    int a = 0;
    while (std::cin >> next_value)
    {
        if (a == 65536) break;
        if (0 <= next_value && next_value <= pow(10.0, 18))
        {
            my_stack.push(next_value);
        }
        else continue;
        a++;
    }

    while (!my_stack.empty())
    {
        std::cout << std::fixed << std::setprecision(4) << sqrt(my_stack.top()) << std::endl;
        my_stack.pop();
    }
    return 0;
}