12 条题解

  • 3
    @ 2024-11-9 13:37:41

    #include<bits/stdc++.h> using namespace std; int main() { int a,b,c; cin>>a>>b>>c; if(a+b>c&&a+c>b&&b+c>a) { if(aa+bbcc||aa+c*cbb||bb+cc==aa) cout<<"Yes"; else cout<<"No"; } else cout<<"Not a triangle"; return 0; }

    • 3

      #include<bits/std\c++.h> using namespace std; int main() { double a,b,c,d,e,f; cin>>a>>b>>c; d=max(max(a,b),c); f=min(min(a,b),c); e=a+b+c-d-f; if(a+b<c&a+c<b&b+c<a) { cout<<"Not a triangle"; } else { if(d=ff+ee) { cout<<"Yes"; } else { cout<<"No"; } } return 0; }

      • 1

        思路

        考察勾股定理。

        code

        #include<bits/stdc++.h>
        using namespace std;
        int a[4];
        int main(){
        	cin>>a[0]>>a[1]>>a[2];
        	sort(a,a+3);
        	if(a[0]+a[1]<=a[2])	puts("Not a triangle");
        	else if(a[0]*a[0]+a[1]*a[1]==a[2]*a[2])	puts("Yes");
        	else	puts("No");
        }
        
        • 1
          @ 2024-11-9 13:20:28
          using namespace std;
          int main()
          {
          	int a,b,c;
          	cin>>a>>b>>c;
          	if(a+b>c&&a+c>b&&b+c>a)
          	{
          		if(a*a+b*b==c*c||a*a+c*c==b*b||c*c+b*b==a*a)
          		cout<<"Yes";
          		else
          		cout<<"No";
          	}
          	else
          	cout<<"Not a triangle";
          	return 0;
          }
          
          
          • 1
            @ 2024-10-16 21:31:59
            #include<bits/stdc++.h> 
            using namespace std; 
            int main() 
            { 
             int a,b,c; 
             cin>>a>>b>>c; 
             if(a+b>c&&a+c>b&&b+c>a) 
             {
             if(aa+bb==c*c) 
              cout<<"Yes"; else cout<<"No"; 
             } 
             else 
              cout<<"Not a triangle"; 
             return 0; 
            }
            
            • 1

              #include<bits/stdc++.h> using namespace std; int main(){ int a,b,c; cin>>a>>b>>c; if(aa+bbcc||aa+c*cbb||bb+cc==aa) cout<<"Yes"; else{ if(a+b<=c||a+c<=b||b+c<=a) cout<<"Not a triangle"; else cout<<"No"; } return 0; }

              • 0
                @ 2024-11-25 17:21:30

                #include<bits/stdc++.h> using namespace std; int main() { int a,b,c; cin>>a>>b>>c; if(a+b>c&&a+c>b&&b+c>a) { if(aa+bbcc||aa+c*cbb||bb+cc==aa) cout<<"Yes"; else cout<<"No"; } else{cout<<"Not a triangle";} return 0; }

                • 0
                  @ 2024-11-9 13:46:50
                  #include<bits/stdc++.h>

                  using namespace std; int main() {long long int a,b,c; cin>>a>>b>>c; if(a+b>c&&a+c>b&&c+b>a) {if(aa+bbcc||aa+c*cbb||cc+bb==aa) cout<<"Yes"; else cout<<"No";} else cout<<"Not a triangle"; return 0; }

                  • 0
                    @ 2024-11-8 13:13:20

                    #include<bits/stdc++.h> using namespace std; int main() { int a,b,c; cin>>a>>b>>c; if(a+b>c&&a+c>b&&b+c>a) { if(aa+bbcc||aa+c*cbb||bb+cc==aa) { cout<<"Yes"; } else { cout<<"No"; } } else { cout<<"Not a triangle"; } return 0; }

                    • 0
                      @ 2023-12-30 17:54:56

                      #include<bits/stdc++.h> using namespace std; int main() {double a,b,c; cin>>a>>b>>c; if(aa+bbcc||aa+c*cbb||bb+cc==aa) {cout<<"Yes";} else if(a+b>c&&a-b<c) {cout<<"No";} else {cout<<"Not a triangle";} return 0; }

                      • 0
                        @ 2023-12-28 0:46:07

                        #include<bits/stdc++.h> using namespace std; int main() { int a,b,c; cin>>a>>b>>c; if(a+b>c&&a+c>b&&b+c>a) {if(aa+bb==c*c) cout<<"Yes"; else cout<<"No"; } else cout<<"Not a triangle"; return 0; }

                        • 0
                          @ 2023-12-27 0:01:25

                          #include<bits/stdc++.h> using namespace std; int main() { int a,b,c; cin>>a>>b>>c; if(aa+bb!=cc) { cout<<"Not a triangle"<<endl; } else if(aa+bb==cc) { cout<<"Yes"<<endl; } else { cout<<"No"<<endl; } return 0; }

                          • 1

                          信息

                          ID
                          33
                          时间
                          1000ms
                          内存
                          256MiB
                          难度
                          5
                          标签
                          递交数
                          224
                          已通过
                          90
                          上传者