1 条题解

  • -16
    @ 2023-11-5 16:45:28

    先求出最小的两边,再进行之后的比较。

    #include<iostream>
    #include<iomanip>
    #include<cmath>
    using namespace std;
    
    int main() {
    	int a,b,c; cin>>a>>b>>c;
    	
    //	if(a>b){ int t=a; a=b; b=t; }
    	if(a>c){ int t=a; a=c; c=t; }
    	if(b>c){ int t=b; b=c; c=t; }
    	// a<=b<=c    ----   a<=c, b<=c
    	if(a+b > c){
    		if(a*a + b*b == c*c) cout<<"zhijiao";
    		if(a*a + b*b < c*c) cout<<"dunjiao";
    		if(a*a + b*b > c*c) cout<<"ruijiao";
    	}else cout<<"no";
    	return 0;
    }
    
    • 1

    信息

    ID
    14
    时间
    1000ms
    内存
    16MiB
    难度
    3
    标签
    递交数
    82
    已通过
    42
    上传者