zoukankan      html  css  js  c++  java
  • Gym 100733 A

    题目:

    After suddenly becoming a billionaire, Shi adopted YOLO as his motto and decided to buy a small european island, which he named Shitalia. Many people decided to move to Shitalia to run away from the economic crisis, and then created the Shitalian mafia, led by Dom Shi.

    The Shitalian economy is based on smuggling spoiled cheese, but, as you can imagine, there aren't many people interested in spoiled cheese. Therefore, Shi decided to earn money with land rental.

    Shitalia is a star-shaped island. Shi is very picky, so he chose a Shi-regular n-star. An n-star is Shi-regular if there are n outer points andn inner points alternated. The outer points must lay on a circle with radius R and the inner points must lay on a circle with radius r and all the points must be equally spaced.

    Print the area of the Shitalia.

     Shi-regular 6-star and 4-star.

    题目大意:(分析)水题,可刚开始没看出来。。

        给你一个n角星型的图案,已知外顶点都在一个圆上(R),内顶点也在一个圆上(r),如上图4角星中的可见的三角形,就是求这2n个三角形的面积和。。

       用到了s=1/2(a*b*sinC),注意,sin()三角函数用的是弧度制。

     1 #include<iostream>
     2 #include<cstdio>
     3 #include<algorithm>
     4 #include<cmath>
     5 using namespace std;
     6 const double pi=acos(-1.0);
     7 const double eps=1e-6;
     8 int main()
     9 {
    10     double n,R,r;
    11     cin>>n>>R>>r;
    12     double ans;
    13     ans=n*(R*r*sin((pi/n)));
    14     printf("%.10lf\n",ans);
    15     return 0;
    16 }
    View Code
  • 相关阅读:
    Linux模拟网络延迟、丢包等
    TestLink汉化操作
    onems设备管理系统(TR-069和OMA)
    Installation Guide Ubuntu 16.04
    Configure GenieACS
    Linux下的tar压缩解压缩命令详解
    genieacs Installation on Ubuntu14.04
    Pyqt中富文本编辑器
    安装MongoDB
    到底什么是贝叶斯?
  • 原文地址:https://www.cnblogs.com/forwin/p/4802294.html
Copyright © 2011-2022 走看看