三角形面積公式大全 c語言,計(jì)算三角形的面積,簡單代碼?
c語言,計(jì)算三角形的面積,簡單代碼?#包括和限制。H>#包含<math。H>void main(){float a,B,C,s,areaprintf(“input a,B,C(space
c語言,計(jì)算三角形的面積,簡單代碼?
#包括和限制。H>#包含<math。H>void main(){float a,B,C,s,areaprintf(“input a,B,C(space to identification a number):”)scanf(%F%F,“,&A,& B,& C)s=(float)0.5*(a B C)area=(float)sqrt(s*(s-a)*(s-B)*(s-C))printf(“area is%F”,area)}擴(kuò)展數(shù)據(jù)C使用邊長計(jì)算三角形區(qū)域#include<bits/STDC。H>usingnamespacestdintmain(){double,B,C,RCIN>>A>>B>>cr=(a B C)/2If(a B>C&&a C&;B C>A)printf(“%。4lf”,sqrt(R*(R-a)*(R-B)*(R-C)))elsecut<“dataerror”return0}
你好。
C三角形面積計(jì)算方法。
#Include<iostream>
#Include<cmath>
使用命名空間STD
int main()
{
float a,B,C,m,S
cout< “請輸入三邊”<&endl
CIN>>A>>B>>C
{
m=(a B C)/2
S=sqrt(m*(m-a)*(m-B)*(m-C))
}
cout<“area is”<<<<<&endl
返回0
}