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

Why does my program isn't working.
Posted by Ilian 4 Aug 2013 17:23
#include<iostream>
#include<stdio.h>
#include<stack>
#include<cmath>
using namespace std;
int main () {
    stack <unsigned long long int> a;
    unsigned long long int num;
    while (scanf("%llu",&num)!=EOF) {
        a.push(num);
        }
    for (;;) {
        printf("%.4lf\n",double(sqrt(double(a.top()))));
        a.pop();
        if (a.empty()==1) break;
        }
    return 0;
}

That's my code. I have WA1. But my program writes right answer for the sample test. Where is my mistake is it printf (i tried with cout but the result was the same.)?

Edited by author 04.08.2013 17:29