课堂笔记四月十三日

    xiaoxiao2021-04-16  30

    三角形求面积(海伦公式)

    #include <bits/stdc++.h> using namespace std; int main() {  double a,b,c,p,s;  cin>>a>>b>>c;  if(a+b>c&&a+c>b&&b+c>a) {  p=(a+b+c/2);  s=sqrt(p*(p-a)*(p-b)*(p-c));  cout<<"s="<<s; }  else cout<<"can't"<<endl;  return 0; }

    
    转载请注明原文地址: https://ju.6miu.com/read-672989.html

    最新回复(0)