计算一个三角形面积,已知边长为a,b,c,s=根号下(s-a)*(s-b)*(s-c)*s,求面积
#define _CRT_SECURE_NO_WARNINGS 1 #include#include int main() { float a, b, c, s, area; scanf("%f,%f,%f,", &a, &b, &c); s = 1.0 / 2*(a+ b + c); area = sqrt(s * (s - a) * (s - b) * (s - c)); printf("a=%7.2f,b=%7.2f,c=%7.2fn", a, b, c, s); printf("area=%7.2fn", area); }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)