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

Solved!!! Test 1001 back sqrt ( C ), please help me understand what's wrong with that
Posted by Viacheslav 20 Oct 2008 17:16
#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
Re: Solved!!! Test 1001 back sqrt ( C ), please help me understand what's wrong with that
Posted by Zdravko Georgiev 24 Oct 2008 22:28
in the line befor the last one you have ";", but you don't need it.