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

哪位高手告诉我为什么WA啊!

Posted by zx191052 at 2006-07-29 11:09:33 on Problem 2051
#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:
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