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

Re:为煞//这个程序在编译器上正确 提交时却 错误

Posted by guanlianjun at 2007-05-27 17:43:53 on Problem 1218
In Reply To:为煞//这个程序在编译器上正确 提交时却 错误 Posted by:guanmeng at 2007-05-25 17:30:36
> #include<iostream.h>
> int x;
> void main()
> {
> 	int i,j=0,b[101],a[101];
> 	cin>>i;
> 	for(int k=0;k<i;k++)
> 		cin>>b[k];
> 		k=0;
> 	while(j<i)
> 	{
> 		for(int n=1;n<=b[k];n++)
> 			a[n]=1;
> 		for(n=2;n<=b[k];n++)
> 		{
> 			for(int m=1;m<=b[k];m++)
> 			{
> 				if(m%n==0)
> 					a[m]=(a[m]+1)%2;
> 			}
> 		}
> 		x=0;
> 		for(int l=1;l<=b[k];l++)
> 		{    
> 		
> 			if(a[l]==1)
> 				x++;
> 		}
> 		cout<<x<<endl;
> 		j++;k++;
> 	}
> }

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