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

计算三角形的周长和面积

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

#include <stdio.h>
#include <math.h>
int main() {
    int a, b ,c ;
    while (scanf("%d %d %d", &a, &b,&c) != EOF) { // 注意 while 处理多个 case
        // 64 位输出请用 printf("%lld") to 
        float p=(a + b + c)/2.0;
        printf("circumference=%.2f area=%.2f",(a+b+c)+0.0, 
        sqrt(p*(p-a)*(p-b)*(p-c)));
    }
    return 0;
}

全部评论

相关推荐

06-25 09:33
厦门大学 Java
程序员饺子:现在日常估计没啥hc了,等到八月多估计就慢慢有了。双九✌🏻不用焦虑的
投递快手等公司7个岗位
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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