二、阅读程序-1
阅读程序,回答下列问题:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #include<iostream> #include<cmath> using namespace std; double f(double a,double b,double c){ double s=(a+b+c)/2; return sqrt(s*(s-a)*(s-b)*(s-c)); } int main(){ cout.flags(ios::fixed); cout.precision(4); int a,b,c; cin>>a>>b>>c; cout<<f(a,b,c)<<endl; return 0; } |
