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

计算三角形的周长和面积

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

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

全部评论

相关推荐

牛客266927136号:为啥实习经历写这么少,项目经历反而大写特写,最重要的还是实习经历吧,写具体点,什么场景下做了什么事,解决了什么问题,优化了什么场景,性能提升了多少多少
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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