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

第一次进第一榜

Posted by ljfljf2006 at 2009-10-19 10:36:01 on Problem 2975
虽然是第一榜最后一名 也要庆祝一下


#include <iostream>
using namespace std;
int num[1005];
int main()
{
	int n,temp,temp2,cnt,i;
	while(scanf("%d",&n)&&n)
	{
		temp=0,cnt=0;;
		for(i=0;i<n;i++)
		{
			scanf("%d",&num[i]);
			temp^=num[i];
		}
		if(temp!=0)
		{
			for(i=0;i<n;i++)
			{
				temp2=temp^num[i];
				if(temp2<num[i]) cnt++;
			}
		}
		printf("%d\n",cnt);
	}
	return 0;
}


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