Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
甩发代码#include <stdio.h> #include <stdlib.h> typedef struct tagRec{ int x,y; }Rec; int cmp(const void *a,const void *b){ Rec *A=(Rec *)a; Rec *B=(Rec *)b; if(A->x!=B->x){ return A->x-B->x; } return A->y-B->y; } int main(){ int i; Rec rec[7]; for(i=1;i<=6;i++){ int x,y; scanf("%d%d",&x,&y); if(x>y){ int tmp=x; x=y; y=tmp; } rec[i].x=x; rec[i].y=y; } qsort(rec+1,6,sizeof(Rec),cmp); if(rec[1].x==rec[2].x&&rec[1].y==rec[2].y&& rec[3].x==rec[4].x&&rec[3].y==rec[4].y&& rec[5].x==rec[6].x&&rec[5].y==rec[6].y&& rec[1].x==rec[3].x&&rec[1].y==rec[5].x&&rec[3].y==rec[5].y){ puts("POSSIBLE"); }else{ puts("IMPOSSIBLE"); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator