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 anyunbin at 2011-05-17 22:20:03 on Problem 1218
#include<iostream>
using namespace std;
int main()
{
	int i,j,n,x,a[111],k,m;
	cin>>m;
	for(k=0;k<m;k++)
	{
	
		x=0;
		cin>>n;
	memset(a,1,111);
	for(i=1;i<=n;i++)
		for(j=1;j<=n;j++)
			if(j%i==0)
				a[j]=!a[j];
	
	for(i=1;i<=n;i++)
		if(a[i]==0)
			x++;
		cout<<x<<endl;
	
	}
	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