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

g++ 4.7.2 Got Runtime error (access violation) on first test
Posted by Gandalf Popstar 4 Dec 2013 19:26
Can`t understand what is the problem

#include <stdio.h>
#include <math.h>

int main()
{
    unsigned long long int a[4096], b;
    int counter=0;
    while(scanf("%llu", &b))
    {
        a[counter]=b;
        counter++;
    }

    for(int i=counter-1; i>=0; i--)
        printf("%.15Lg\n", (long double)sqrt(a[i]));
    return 0;
}
Re: g++ 4.7.2 Got Runtime error (access violation) on first test
Posted by [ONPU-13]Asalle 2 Feb 2014 19:46
1) while(scanf("%llu", &b) != EOF)
2) Maybe it's ok, but why do you printf("%.15Lg\n)? 4 symbols after the dot is not ennough, or I don't understand sth?