题解 | #判断三角形类型#
判断三角形类型
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")