Skip to content

Instantly share code, notes, and snippets.

@mob5566
Created May 19, 2015 06:43
10209 - Is This Integration ?
/**
* Tittle: 10209 - Is This Integration ?
* Author: Cheng-Shih, Wong
* Date: 2015/05/19
*/
// include files
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
// definitions
#define FOR(i,a,b) for( int i=(a),_n=(b); i<=_n; ++i )
#define clr(x,v) memset( x, v, sizeof(x) )
// declarations
const double PI = acos(-1.0);
double r;
double area;
double A, B, C;
// functions
// main function
int main( void )
{
area = PI/3.0 - 4.0*cos(PI*75/180)*sin(PI*75/180) + 2.0 - sqrt(3.0);
// input
while( scanf( "%lf", &r )==1 ) {
// solve
A = r*r*area;
B = r*r*(PI-2.0) - 2.0*A;
C = r*r - A - B;
// output
printf( "%.3lf %.3lf %.3lf\n", A, B, C );
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment