比较简单的题目,注意掉精度的问题就ok,
#include<bits/stdc++.h> using namespace std; const int MAXN = 100000 + 10; int n , m, a[MAXN]; int main() { double a, b, r; cin >> r >> a >> b; double S = r * r * acos(-1.0) / 4; //cout << S << endl; double temp = b / r; S -= asin(temp) * r * r / 2 ; //cout << S << endl; temp = a / r; S -= asin(temp) * r * r / 2 ; //cout << S << endl; temp = sqrt(r * r - a * a) - b ; S -= temp * a / 2; //cout << S << endl; temp = sqrt(r * r - b * b) - a; S -= temp * b / 2; cout.precision(2); cout << fixed << S; return 0; }