Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
到底每次做完之后q应在哪个地方清0呀????????#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator