Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

不知道错在哪啊?麻烦各位帮忙看一下,调试了n次了啊

Posted by health at 2008-05-24 10:21:14 on Problem 2160
#include<stdio.h>
main()
{ int a[6],b[6],i,j,t,t1,t2;
  for(i=0;i<6;i++)
  { scanf("%d%d",&a[i],&b[i]);
    if(a[i]<b[i])
    { t=a[i];
      a[i]=b[i];
      b[i]=t;}
   }
for(i=0;i<5;i++)
 for(j=0;j<5-i;j++)
 { if(a[j]<a[j+1])
    { t1=a[j];
      a[j]=a[j+1];
      a[j+1]=t1;
       t2=b[j];
      b[j]=b[j+1];
      b[j+1]=t2;}
  }
i=0;
while(i<6)
{ if((a[i]!=a[i+1])||(b[i]!=b[i+1])) break;
  else i+=2;
 }
if(i==6)
 {  if(a[0]==a[2])
    {if((a[0]==a[2])||(a[0]==b[2])||(b[0]==a[2])||(b[0]==b[2]))
      {if((a[2]==a[4])||(a[2]==b[4])||(b[2]==a[4])||(b[2]==b[4]))
        { if((a[0]==a[4])||(a[0]==b[4])||(b[0]==a[4])||(b[0]==b[4]))
           printf("POSSIBLE\n");
         else printf("IMPOSSIBLE\n");
         }
       else printf("IMPOSSIBLE\n");
      }
    else printf("IMPOSSIBLE\n");
   }
   else printf("IMPOSSIBLE\n");
   }
   else printf("IMPOSSIBLE\n");
getch();
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator