①掌握结构体的运用
②掌握c++库中sort函数第三个参数cmp的运用(也就是定义这个类型的小于运算符!
#include<algorithm>
#include<cstdio>
using namespace std;
struct rec
{
int x;int y;
}widhe[6];
bool cmp(rec a,rec b)
{
if(a.x!=b.x) return a.x<b.x;
if(a.x==b.x) return a.y<b.y;
}
int main()
{ int i;
while(scanf("%d%d",&widhe[0].x,&widhe[0].y)==2)
{ int flag=1;
if(widhe[0].x>widhe[0].y) swap(widhe[0].x,widhe[0].y);
for(i=1;i<6;i++)
{
scanf("%d%d",&widhe[i].x,&widhe[i].y);
if(widhe[i].x>widhe[i].y) swap(widhe[i].x,widhe[i].y);
}
sort(widhe,widhe+6,cmp);
for(i=0;i<6;i+=2)
{
if(widhe[i].x!=widhe[i+1].x||widhe[i].y!=widhe[i+1].y) flag=0;
}
if(widhe[0].x!=widhe[2].x||widhe[2].y!=widhe[4].y||widhe[0].y!=widhe[5].x) flag=0;
flag?printf("POSSIBLE\n"):printf("IMPOSSIBLE\n");
}
}