题解 | #判断三角形类型#

判断三角形类型

https://www.nowcoder.com/practice/1521dea0744c46ad8c31b0bd860625d0

#include <bits/stdc++.h>
using namespace std;

int main() {
    int arr[3];
    cin>>arr[0]>>arr[1]>>arr[2];
    sort(arr,arr+3);
    int smallPow = arr[0]*arr[0]+arr[1]*arr[1];
    int bigPow = arr[2]*arr[2];
    if(smallPow == bigPow){
        cout<<"直角三角形"<<endl;
    }else if(smallPow>bigPow){
        cout<<"锐角三角形"<<endl;
    }else{
        cout<<"钝角三角形"<<endl;
    }
}
// 64 位输出请用 printf("%lld")

全部评论

相关推荐

菜菜狗🐶:双非之光
找工作,你会甘心进小厂还...
点赞 评论 收藏
分享
2025-11-10 08:05
河北师范大学 Java
用微笑面对困难:你出于礼貌叫了人一声大姐,大姐很欣慰,她真把你当老弟
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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