Welcome Guest.

Asked by: Mitchell 195 views IT July 26, 2018

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

+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 |

+5Votes

我建议用double，精度高

#include <iostream>

#include <cmath>

int main() {

double n;

cin>>n;

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

return 0;

}

David- July 28, 2018 |

+1

Votes这个公式可直接写在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 |

+5

Votes我建议用double，精度高

#include <iostream>

#include <cmath>

int main() {

double n;

cin>>n;

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

return 0;

}

David- July 28, 2018 |