竞赛
考级
666
首先,我们先写好基本框架: 接着创建3个变量: 然后写个if-else,注意条件(t1+t2>t3 && t2+t3>t1 && t3+t1>t2): 最后,结合起来(答案): 保证让你得AC!
复仇者_among us
#include <bits/stdc++.h> using namespace std; int main(){ int x,y,z; cin >> x >> y >> z; if(x+y>z && x+z>y && z+y>x){ cout << "yes"; }else{ cout << "no"; } return 0; }
😋🙀😡😤
Lprince
#include <bits/stdc++.h> using namespace std; long long a,b,c; void triangle() { if(a+b>c and a+c>b and b+c>a) cout<<"yes"; else cout<<"no"; } int main(){ cin>>a>>b>>c; triangle(); return 0; }
使一颗心免于悲伤
#include<bits/stdc++.h> using namespace std; bool is_tri(int a[]){ sort(a+1,a+4); if(a[1]+a[2]>a[3]){ return 1; } return 0; } int main(){ int a[4]; for(int i=1;i<=3;i++){ cin>>a[i]; } if(is_tri(a)){ cout<<"yes"; } else cout<<"no"; return 0; }
法西斯玫瑰
别来下蛋
#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){ cout<<"yes"; } else{ cout<<"no"; } }
乌鸦砂糖橘
*****a,b,c=map(int,input().split()) if a+b>c and b+c>a and c+a>b: print("yes") else: print("no") ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Python 中可以使用 input().split() 来读取一行输入,并用 map() 将其转换为整数。 赋值变量:将分割后的三个整数分别赋值给变量 a,b 和 c。 判断逻辑:根据三角形不等式,检查是否满足条件。 输出结果:如果满足条件,输出 "yes";否则输出 "no"。 从逻辑上看,条件判断部分为: if a+b>c and b+c>a and c+a>b(符合三角形不等式的定义)
伊邪那美愚蠢欧豆豆(秽土转生版)
#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; }
阿兹卡班
正常
huangboxiang
#include<iostream> using namespace std; int main(){ int a,b,c; cin >>a>>b>>c; if(a+b>c&&b+c>a&&a+c>b ) { cout << "yes"; } else { cout << "no"; } return 0; }
魏敬平
#include<iostream> using namespace std; int main(){ int a,s,d; cin>>a>>s>>d; if(a+s>d&&a+d>s&&s+d>a){ cout<<"yes"; }else{ cout<<"no"; } return 0; }
王
复仇者_无奈
#include<iostream> using namespace std; int main(){ long long a,b,c; cin>>a>>b>>c; if(a+b>c&&a+c>b&&b+c>a){ cout<<"yes"; } else{ cout<<"no"; } return 0; }
windows🐱💻
无注释
潜龙暗虎
逍遥骇好=&
逆思想 #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<<"no"; else cout<<"yes"; }
Pai
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c; if(a+b>c&&a+c>b&&c+b>a){ cout<<"yes"; } else{ cout<<"no"; } }
菜
#include<bits/stdc++.h> using namespace std ; int main(){ int a,b,c ; cin >> a>> b >> c ; if(a+b+c-max(a,max(b,c))<=max(a,max(b,c)))cout << "no" ; else { cout << "yes" ; } return 0 ; }
137****3354
共100条