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 i got wrong ans @ C++
Posted by iCE Hin 20 Jul 2011 19:02
#include <cmath>
#include <cstdio>
#define MAXBUF 256*1024

using namespace std;

double list[256*1024/8];
int i, nc;

int main(){

    while ( nc < MAXBUF && scanf("%lf", &list[i]) ){
        ++i;
        nc += sizeof(list[i]);
    }

    for ( int j = i - 1 ; j >= 0; --j )
        printf("%.4lf\n", sqrt(list[j]) );

    return 0;
}

Edited by author 20.07.2011 19:09