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

Common Board

Problem 1084
Posted by Wendell 6 Apr 2003 20:04
I got Compilation Error.But my program works correctly in VC6.
Please help me.
My program:
#include <iostream.h>
#include <stdio.h>
#include <math.h>
int main()
{
    long double gardensize;
    long double cordlenth;
    long double s;
    cin >> gardensize >> cordlenth;
    if(gardensize*sqrt(2) <= 2*cordlenth) {
        s = pow(gardensize,2);
        printf("%.3f", s);
    } else if(gardensize < 2*cordlenth) {
        s = sqrt(pow(cordlenth,2) - (pow(gardensize,2)/4.00))
*gardensize*2;
        s = 3.1415926 * pow(cordlenth,2) -  (4 * acos
(gardensize/(2*cordlenth))*pow(cordlenth,2)) + s;
        printf("%.3f", s);
    } else if(gardensize >= 2*cordlenth) {
        s = 3.1415926 * cordlenth * cordlenth;
        printf("%.3f",s);
    }
    printf("\n");
    return 0;
}