1 条题解
-
0
C++ :
#include<iostream> #include<cmath> #include<cstdio> #define S(a,b,c) (a+b+c)/2 #define AREA(a,b,c) sqrt(S(a,b,c)*(S(a,b,c)-a)*(S(a,b,c)-b)*(S(a,b,c)-c)) using namespace std; int main() { double a,b,c; cin>>a>>b>>c; printf("%.3lf\n",AREA(a,b,c)); return 0; }
Pascal :
var a,b,c,p,s:real; begin read(a,b,c); if ((a+b)>c) and ((b+c)>a) and ((a+c)>b) then begin p:=(a+b+c)/2; s:=sqrt(p*(p-a)*(p-b)*(p-c)); write(s:0:3); end; end.
- 1
信息
- ID
- 1570
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- (无)
- 标签
- (无)
- 递交数
- 0
- 已通过
- 0
- 上传者