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 |
各路高手@ 此程序在编译器上是对的呀!! 而它说“Wrong Answer ”#include<stdio.h> int main(){ int i,j,k,x,sum[202],a[202],n[200],m; for(i=1;i<=101;i++){ sum[i]=0; } scanf("%d",&x); for(i=1;i<=x;i++){ scanf("%d",&n[i]); } for(j=1;j<=x;j++){ for(i=1;i<=n[j];i++){ a[i]=1; } for(i=1;i<=n[j];i++){ m=1; k=m*i; while(k<=n[j]){ if(a[k]==0) a[k]=1; else a[k]=0; m++; k=m*i; } } for(k=1;k<=n[j];k++){ if(a[k]==0) sum[j]++; else continue; } } for(i=1;i<=x;i++) printf("%d\n",sum[i]); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator