官方标签都是:暴力、几何了……我还能说什么……这道题需要知道的就是三角形两边之和大于第三边
贴的是咖喱(ZoeCUR)的C语言解法【反正是我家的,就是我的】,其实没太大差啦,这道题就这样啦~水题可跳
#include<stdio.h>
int main()
{
int a[4];
for(int i=0;i<4;i++)scanf("%d",&a[i]);
for(int j=0;j<4;j++)
{ for(int k=j+1;k<4;k++)
{
if(a[k]<a[j])
{
int temp;
temp=a[j];
a[j]=a[k];
a[k]=temp;
}
}}
if((a[0]+a[1])<a[2]&&a[0]+a[2]<a[3]&&a[1]+a[2]<a[3])printf("IMPOSSIBLE");
else if(a[0]+a[1]>a[2]||a[0]+a[2]>a[3]||a[1]+a[2]>a[3])printf("TRIANGLE");
else printf("SEGMENT");
return 0;
}