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

Help~~~~~~~~到底是哪里错了啊??????

Posted by nopeak at 2005-02-01 16:48:52 on Problem 2160
#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:
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