Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement