2 条题解

  • 1

    #include<bits/stdc++.h> using namespace std; int main(){ int a,b,c; cin>>a>>b>>c; if(a>c)swap(a,c); if(b>c)swap(b,c); if(a>c)swap(a,c); if(b>c)swap(b,c); if(a+b<=c){ cout<<"Not triangle"; exit(0); } if(pow(a,2)+pow(b,2)pow(c,2))cout<<"Right triangle"<<endl; if(pow(a,2)+pow(b,2)>pow(c,2))cout<<"Acute triangle"<<endl; if(pow(a,2)+pow(b,2)<pow(c,2))cout<<"Obtuse triangle"<<endl; if(ab||ac||bc)cout<<"Isosceles triangle"<<endl; if(ab&&bc)cout<<"Equilateral triangle"<<endl; return 0; } 代码有点儿长,嘿嘿嘿

    • 0
      @ 2024-12-30 22:08:14

      #include<bits/stdc++.h> using namespace std; int main(){ int a,b,c,d; cin>>a>>b>>c; d=0; if ((a+b)>c and (a+c)>b and (b+c)>a) {d=1;} else {cout<<"Not triangle"<<endl;} if (d1) {if((aa+bb)>cc and (aa+cc)>bb and (bb+cc)>aa) {cout<<"Acute triangle"<<endl;} if ((aa+bb)==cc or (aa+cc)bb or (bb+cc)==aa) {cout<<"Right triangle"<<endl;} if ((aa+bb)<cc or (aa+cc)<bb or (bb+cc)<a*a) {cout<<"Obtuse triangle"<<endl;} if (ab or ac or bc) {cout<<"Isosceles triangle"<<endl;} if (ab and a==c) {cout<<"Equilateral triangle"<<endl;}} return 0; } //=,=自己补

      • 1

      信息

      ID
      9739
      时间
      1000ms
      内存
      128MiB
      难度
      2
      标签
      (无)
      递交数
      28
      已通过
      17
      上传者