Welcome Guest.

2Answers

C language is simple to write

Asked by: Mitchell 195 views IT July 26, 2018

There is a formula for -n*sin(180/n), which is written by God.

2 Answers

  1. +1Votes  

    这个公式可直接写在c语言中的

    #include <stdio.h>
    #include <math.h>
    int main()
    {
     float n;
     scanf("%f",&n);
       printf("%f\n", -n*sin(180/n));
    return 0;  
     
    }

    Mary- July 27, 2018 |

  2. +5Votes  

    我建议用double,精度高

    #include <iostream> 

    #include <cmath> 

    int main() { 

     double n; 

    cin>>n;   

     cout<<-n*sin(180/n); 

    return 0;   

     }

    David- July 28, 2018 |