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 1004123217 at 2013-10-26 17:23:49 on Problem 2864
#include<stdio.h>
#include<math.h>
#include<iostream>
using namespace std;
int main()
{
    int n,d;
    while(scanf("%d%d",&n,&d)&&n&&d)
    {
        int i,j,p;
        int dinner[502][102];
        for(j=0;j<d;j++)
        {
            for(i=0;i<n;i++)
            scanf("%d",&dinner[j][i]);
        }
        for(i=0;i<n;i++)
        {
            for(j=0;j<d;j++)
            {
                if(dinner[i][j]==0)
                {
                    p=0;
                    break;
                }
                else p=1;
            }
        }
        if(p==1)
        printf("yes\n");
        else printf("no\n");
    }
    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