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 |
哪位高手告诉我为什么WA啊!#include "stdio.h" #include "string.h" int main() { char a[3005][8]; int q[3005],p[3005],n,i,j,k,t; while(scanf("%s",a[0])!=EOF) { if(a[0][0]=='#') break; memset(p,0,sizeof(p)); memset(q,0,sizeof(q)); scanf("%d%d",&q[0],&p[0]); t=0; for(i=1;;i++) { scanf("%s",a[i]); if(a[i][0]=='#') break; scanf("%d%d",&q[i],&p[i]); } j=i; scanf("%d",&n); for(k=1;;k++) { for(i=0;i<j;i++) { if(k%p[i]==0) { printf("%d\n",q[i]); t++; if(t==n) break; } } if(t==n) break; } memset(a,0,sizeof(0)); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator