UVA 10432 - Polygon Inside A Circle

UVA Sep 1, 2020

Problem PDF

Solution:

/*-------------------------------------------------------------*/
//Poblem Setter : Suman Mahbub
//Uva Problem No: 10432
//Problem Name  : Polygon Inside A Circle
//Type          : Geometry, Area of a regular convex polygon.
//Author        : Shipu Ahamed
//University    : BUBT
//E-mail        : [email protected]
/*--------------------------------------------------------------*/

#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define ll long long
#define sc scanf
#define pf printf
#define pi 2*acos(0.0)
using namespace std;
int main()
{
 double r,s,p;
 while(sc("%lf %lf",&r,&s)==2)
        pf("%.3lf\n",r*r*s*sin((2*pi)/s)/2);
 return 0;
}
https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/10432/10432.cpp

Tags

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.