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

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

int main(){

int sz = 256 * 1024 * 4; // Error was their - need more memory for input data

double *sp, *fp, *p;

    sp = (double *)malloc(sz);
    fp = sp + (sz / sizeof(double));

    for(p = sp; (p < fp) && (scanf("%lf", p) != EOF); p++);
    while(p > sp){
        --p;
        printf("%.4lf\n", sqrt((double)(*p)));
    };
}

Edited by author 20.10.2008 22:53
in the line befor the last one you have ";", but you don't need it.