只有67分,求助大佬!
查看原帖
只有67分,求助大佬!
1091602
Dear123楼主2023/11/2 23:08

测试用例好像没什么问题,不知道错在哪了,希望可以帮忙看看,谢谢!

#include <iostream>
using namespace std;
int main(){
    long long a,b,c;
    cin>>a>>b>>c;
    int temp=0;
    if(a>b){
        temp=b;
        b=a;
        a=temp; 
    }
    if(b>c){
        temp=c;
        c=b;
        b=temp;
    }
    if(a>b){
        temp=b;
        b=a;
        a=temp; 
    }
    int A=a*a,B=b*b,C=c*c;
    if(a+b>c||a+c>b||b+c>a){
        if(A+B==C) cout<<"Right triangle"<<endl;
        if(A+B>C) cout<<"Acute triangle"<<endl;
        if(A+B<C) cout<<"Obtuse triangle"<<endl;
        if(a==b) cout<<"Isosceles triangle"<<endl;
        if(a==b&&a==c) cout<<"Equilateral triangle"<<endl;
    }else cout<<"Not triangle";
}
2023/11/2 23:08
加载中...