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 swust20064469 at 2008-04-17 15:04:31 on Problem 2864
#include<iostream>
using namespace std;
int a[105][505],n,d;
int main()
{
	int i,j,flag;
	while(scanf("%d%d",&n,&d)==2)
	{
		if(!n&&!d)
			break;
		if(n==0||d==0)
			continue;
		for(i=1;i<=d;i++)
			for(j=1;j<=n;j++)
				scanf("%d",&a[i][j]);
		flag=0;
		for(j=1;j<=n;j++)
		{
			int ans=0;
			for(i=1;i<=d;i++)
			{
				if(a[i][j]==0)
					break;
				ans++;
			}
			if(ans==d)
			{
				flag=1;
				break;
			}
		}
		//printf("%s\n",(flag>0)?"yes":"no");
		if(flag)
			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