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

到底每次做完之后q应在哪个地方清0呀????????

Posted by 00430030 at 2004-12-30 10:24:52 on Problem 1218
#include<stdio.h>
#include<math.h>
void main() 
{
   int i,j,l,k,q,m,n,p[101]={0};
    scanf("%d",&m);
   for(k=0;k<m;k++)

{ 
      scanf("%d",&n);
      for(i=1;i<=n;i++)
	 {for(j=1;j<=i;j++)
       if(i%j==0)  p[i]++;}
                             
	 for(l=1;l<=n;l++)
       if(p[l]%2)   q=q+1;
       printf("%d\n",q);

  }
}



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