SHARE
TWEET

Untitled

a guest Aug 23rd, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<iostream>
  2. #include<cmath>
  3. #include<iomanip>
  4. using namespace std;
  5.  
  6. int main(){
  7.  
  8.  
  9.     double pi=acos(-1.0);
  10.     double p=pi/180;
  11.  
  12.     int x,s,n;
  13.  
  14.     cin>>x;
  15.     for(int i=1;i<=x;i++){
  16.  
  17.         cin>>n>>s;
  18.         double t=180/n;
  19.         double r = s/(2*sin(t*p));
  20.         double area = pi*r*r - ((s*s*n)/(4*tan(t*p)));
  21.  
  22.         cout<<"Case "<<i<<": ";
  23.         cout<<fixed<<setprecision(2)<<area<<endl;
  24.  
  25.  
  26.     }
  27.  
  28.     return 0;
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top