4 条题解

  • 1
    @ 2023-12-2 19:37:22
    #include <iostream>
    using namespace std;
    int main()
    {
        int a , b , c;
        cin >> a >> b >> c;
        if((a + b > c)&&(a + c > b)&&(b + c > a))
        {
            cout << "yes";
        }
        else
        {
            cout << "no";
        }
        return 0;
    }
    
    • 0
      @ 2024-4-27 9:37:55
      #include <iostream>
      using namespace std;
      int main()
      {
          int a,b,h;
          cin >> a >> b >> h;
          if (((a+b) >h)&&((b+h)>a)&&((a+h)>b))//这里要用并且&&判断
              cout << "yes";
          else
              cout << "no";
          return 0;
      }
      
      • 0
        @ 2023-7-28 10:24:13
        #include<bits/stdc++.h>
        using namespace std;
        int main()
        {
            int a[5];
            cin>>a[1]>>a[2]>>a[3];
            sort(a+1,a+4);
            if (a[1]+a[2]>a[3])
            {
                cout<<"yes";
            }
            else
            {
                cout<<"no";
            }
            return 0;
        } 
        

        直接排序

        • 0
          @ 2023-6-20 0:57:46
          #include <iostream>
          #include <cstdio>
          #include <cstring>
          using namespace std;
          int main() {
          	int a, b, c;
          	cin >> a >> b >> c;
          	if (a + b > c && a + c > b && b + c > a) {
              	
          		cout << "yes";
          	}
          	else {
          		cout <<"no";
          	}
          	return 0;
          }
          
          • 1

          信息

          ID
          156
          时间
          1000ms
          内存
          128MiB
          难度
          2
          标签
          递交数
          216
          已通过
          129
          上传者