牛牛爱几何

牛牛爱几何

https://ac.nowcoder.com/acm/problem/205067

解题思路

题目中的阴影面积为

C++代码

#include<iostream>
#include<iomanip>
using namespace std;

const long double pi = 3.1415926535;

int main(){
    int n;
    while(cin >> n){
        long long square = 1LL * n * n;
        long double ans = (pi - 2) * square / 2.0;
        cout << fixed << setprecision(6) << ans << endl;
    }
    return 0;
}
全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务