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 771385494 at 2011-12-29 21:19:50 on Problem 2234
#include <iostream>
using namespace std;
int main()
{
	int n,array[20],i;
	while(scanf("%d",&n) != EOF){
		int total = 0;
		for(i = 0;i < n;i++)
		{
			cin >> array[i];
			total += array[i];
		}
		if(total % 2 != 0)
		{
			cout << "Yes\n";
		}
		else
		{ 
			if(n % 2 == 0)
				cout << "No\n";
			else
				cout << "Yes\n";
		}
	}
	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