Convex HDU - 5979(数论,三角形面积)
水题,高中数学公式...AC代码:#include <iostream>#include <cstring>#include <string>#include <cstdio>#include <cmath>#include <algorithm>#define IOS ios::sync_with_stdio(false);
·
水题,高中数学公式...
AC代码:
#include <iostream>
#include <cstring>
#include <string>
#include <cstdio>
#include <cmath>
#include <algorithm>
#define IOS ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
const int maxn=1e6+5;
const double pi=3.1415926;
typedef long long ll;
int main() {
IOS;
int n,d;
while(cin>>n>>d){
double ans=0;
for(int i=1;i<=n;i++){
double x;
cin>>x;
ans+=0.5*d*d*sin(x*pi/180);
}
printf("%.3lf\n",ans);
}
}
更多推荐
已为社区贡献4条内容
所有评论(0)