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 |
Help~~~~~~~~到底是哪里错了啊??????#include<stdio.h> void main() { int i,a[12],t=0,num1=1,num2,flag=1; for(i=0;i<12;i++)scanf("%d",&a[i]); for(i=1;i<12;i++) { if(a[i]==a[0])num1++; else t=a[i]; } if(num1%4)flag--; for(i=1,num2=0;i<12&&flag;i++) { if(a[i]==t)num2++; } if(num2%4)flag--; if(num1==8) { for(i=0;i<11&&flag;i+=2) { if(a[i]==t&&a[i+1]==t){flag--;break;} } } if(num2==8) { for(i=0;i<11&&flag;i+=2) { if(a[i]==a[0]&&a[i+1]==a[0]){flag--;break;} } } if(num1==4&&num2==4) { for(i=0;i<11&&flag;i+=2) { if(a[i]==a[i+1]){flag--;break;} } } if(flag)printf("POSSIBLE\n"); else printf("IMPOSSIBLE\n"); } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator