3 条题解

  • 1
    @ 2025-7-5 9:49:33
    
    #include <bits/stdc++.h> 
    using namespace std; 
    int main() 
    { 
    	int a[10]; 
    	for(int i=1;i<=3;i++) 
    	{ 
    		cin>>a[i]; 
    	} 
    	sort(a+1,a+3+1); 
    	if(a[1]+a[2]<=a[3]) 
    	{ 
    		cout<<"Not triangle"<<endl; 
    	} else { 
    		if(a[1]*a[1]+a[2]*a[2]>a[3]*a[3]) 
    		{ 
    			cout<<"Acute triangle"<<endl; 
    		} 
    		if(a[1]*a[1]+a[2]*a[2]==a[3]*a[3]) 
    		{ 
    			cout<<"Right triangle"<<endl; 
    		} 
    		if(a[1]*a[1]+a[2]*a[2]<a[3]*a[3]) 
    		{ 
    			cout<<"Obtuse triangle"<<endl; 
    		} 
    		if(a[1]==a[2]||a[2]==a[3]||a[1]==a[3]) 
    		{ 
    			cout<<"Isosceles triangle"<<endl; 
    		} 
    		if(a[1]==a[2]&&a[2]==a[3]&&a[1]==a[3]) 
    		{ 
    			cout<<"Equilateral triangle"<<endl; 
    		} 
    	} 
    	return 0; 
    }
    
    • 1
      @ 2024-12-13 11:47:02

      #include <bits/stdc++.h> using namespace std; int main() { int a[10]; for(int i=1;i<=3;i++) { cin>>a[i]; } sort(a+1,a+3+1); if(a[1]+a[2]<=a[3]) { cout<<"Not triangle"<<endl; } else { if(a[1]*a[1]+a[2]*a[2]>a[3]*a[3]) { cout<<"Acute triangle"<<endl; } if(a[1]*a[1]+a[2]*a[2]==a[3]*a[3]) { cout<<"Right triangle"<<endl; } if(a[1]*a[1]+a[2]*a[2]<a[3]*a[3]) { cout<<"Obtuse triangle"<<endl; } if(a[1]==a[2]||a[2]==a[3]||a[1]==a[3]) { cout<<"Isosceles triangle"<<endl; } if(a[1]==a[2]&&a[2]==a[3]&&a[1]==a[3]) { cout<<"Equilateral triangle"<<endl; } } return 0; }/啥实力啊? Le Zi说话!/

      • @ 2025-2-22 15:36:17

        人机吧,什么78代码装你m呢

    • 0
      @ 2025-7-6 17:09:09

      #include <bits/stdc++.h> using namespace std; int main () { int a,s,d,f; cin>>a>>s>>d; if(a>s) { f=a; a=s; s=f; } if(a>d) { f=a; a=d; d=f; } if(s>d) { f=s; s=d; d=f; } if(a+s<=d) { cout<<"Not triangle"<<endl; return 0; } if(aa+ssdd) { cout<<"Right triangle"<<endl; } if(aa+ss>dd) { cout<<"Acute triangle"<<endl; } if(aa+ss<d*d) { cout<<"Obtuse triangle"<<endl; } if(as || ad || sd) { cout<<"Isosceles triangle"<<endl; } if(as && sd) { cout<<"Equilateral triangle"<<endl; } return 0; }

      • 1

      信息

      编号
      2311
      时间
      1000ms
      内存
      256MiB
      难度
      3
      标签
      递交数
      164
      已通过
      40
      上传者