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 test 3
Posted by 4ever_young 4 Feb 2012 18:46
I don't understand what problem is it


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

int main()
{
    long double i[10000] = {0};
    int c,tmp,j=0;
    while ((c = getchar()) != EOF)
    {
        if ( (c != ' ') && ( c != '\n' ) && ( c != '\t' ) && ( c != '\0' ) )
        {
            i[j] = i[j]*10 + ((int)c - 48) ;
        }
        if ( ( tmp!=' ' && tmp!='\n' && tmp!='\t' && tmp!='\0' ) && ( c == '\0' || c==' ' || c=='\n' || c=='\t' ) )
            j++;
        tmp = c;
    }
    for ( j-- ; j>=0 ; j--)
    {
        printf("%Lf\n", sqrtl(i[j]));
    }
    return 0;
}

What is about the test 3 ?
Re: wrong answer test 3
Posted by beyondliyang 4 May 2012 09:57
first:temp used without being initialized
second:when do the while end up if I just put in 3 numbers