题解 | #计算三角形的周长和面积#

计算三角形的周长和面积

https://www.nowcoder.com/practice/109a44d649a142d483314e8a57e2c710

#include<stdio.h>
#include<math.h>
int main()
{
	float a = 0.0; 
	float b = 0.0; 
	float c = 0.0; 
	scanf("%f%f%f", &a, &b, &c);  
	float cir = a + b + c;  
	float p = cir / 2;  
	float s = sqrt(p * (p - a) * (p - b) * (p - c));  
	printf("circumference=%.2f area=%.2f", cir, s);  
	return 0; 
}

全部评论

相关推荐

03-04 07:14
门头沟学院 C++
后测速成辅导一两个月...:老板:都给工作机会了还想要工资,哪来这么多好事
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务