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 pl02206984 at 2010-03-07 21:13:03 on Problem 2864
怎么回事啊,怎么老是WA啊,难道我题目理解错了。大家帮我看看啊
#include <cstdio>
int main()
{
	int n,m,i,j,sum=0,s=0;
	while(1)
	{
		scanf("%d%d",&n,&m);
		if(n==0&&m==0) break;
		int a[m+5][n+5];
		for(i=0;i<m;i++)
		{
			for(j=0;j<n;j++)
			scanf("%d",&a[j][i]);
		} 
		for(i=0;i<n;i++)
		{
			for(j=0;j<m;j++)
			{
				if(a[j][i]==1)
				sum=sum+1;
			}
			if(sum==m)
			s=s+1;
		}
		if(s==n)	
		printf("yes\n");
		else
		printf("no\n");	
	
	}
}

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