Search This Blog

Friday, 19 August 2016

SPOJ - Build a Fence Problem Solution

SPOJ - Build a Fence Problem Solution

Solution :-

#include<bits/stdc++.h>
using namespace std;
#define PI 3.141592654

int main()
{
    double area,n;
    while(1)
    {
        cin>>n;
        if(!n)
            break;

        area=(n*n)/(2*PI);
        cout<<fixed<<setprecision(2)<<area<<endl;
    }
    return 0;

}

No comments:

Post a Comment