Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cmath>
- #include<iomanip>
- using namespace std;
- int main(){
- double pi=acos(-1.0);
- double p=pi/180;
- int x,s,n;
- cin>>x;
- for(int i=1;i<=x;i++){
- cin>>n>>s;
- double t=180/n;
- double r = s/(2*sin(t*p));
- double area = pi*r*r - ((s*s*n)/(4*tan(t*p)));
- cout<<"Case "<<i<<": ";
- cout<<fixed<<setprecision(2)<<area<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement