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

为什么还是WA呢?

Posted by hujk2008 at 2004-06-16 21:45:41 on Problem 1609
#include<stdio.h>
int main()
{
	int n,i,temp1,temp2,temp3;
	struct dat
	{
		int a;int b;
	}a;
	while((scanf("%d",&n))!=EOF)
	{
		if(n==0){printf("*\n");return 1;}
		temp1=0;temp2=0;temp3=0;
		if(n==0){printf("*\n");return 1;}
		for(i=0;i<n;i++)
		{
			scanf("%d%d",&a.a,&a.b);
			if(a.a%2&&a.b%2)
			{temp1++;continue;}
			if(!(a.a%2)&&!(a.b%2))
			{	temp2++;continue;}
			else
				temp3++;
		}
			if(temp1<temp2)temp1=temp2;
			if(temp1<temp3)temp1=temp3;
			printf("%d\n",temp1);
	}
	return 1;
}

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