A

水题

 1 #include<bits/stdc++.h>
 2 using namespace std;
 3 #define lson l,mid,rt<<1
 4 #define rson mid+1,r,rt<<1|1
 5 #define sqr(x) ((x)*(x))
 6 #define maxn 1000010
 7 typedef long long ll;
 8 /*#ifndef ONLINE_JUDGE
 9         freopen("1.txt","r",stdin);
10 #endif */
11 
12 int Check(int a,int b,int c){
13     if(a+b>c&&a+c>b&&b+c>a) return 1;
14     if(a+b==c||a+c==b||b+c==a) return 0;
15     return -1;
16 }
17 
18 int main(){
19     #ifndef ONLINE_JUDGE
20       //  freopen("1.txt","r",stdin);
21     #endif
22     int a,b,c,d;
23     cin>>a>>b>>c>>d;
24     int flag=-1;
25     flag=max(flag,Check(a,b,c));
26     flag=max(flag,Check(a,c,d));
27     flag=max(flag,Check(a,b,d));
28     flag=max(flag,Check(b,c,d));
29     if(flag==1) cout<<"TRIANGLE"<<endl;
30     else if(!flag) cout<<"SEGMENT"<<endl;
31     else cout<<"IMPOSSIBLE"<<endl;
32 }
View Code

相关文章: