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

老是错!唉!

Posted by 20084858 at 2010-03-03 20:10:50 on Problem 3740
#include<iostream>
using namespace std;
int jz[17][300];
int main()
{
int m,n,i,j;
while(cin>>m>>n)
{int flag=0;
	//memset(c,0,sizeof(c));
int c[100]={0};
int b[100]={0};
	for(i=0;i<m;i++)
		for(j=0;j<n;j++)
		{		cin>>jz[i][j];
	
			if(jz[i][j]==1)
			{	c[i]+=1;
			b[j]+=1;}
		}
		for(i=0;i<m;i++)
		{	if(c[i]!=1)
			flag=1;
		break;
}
		for(j=0;j<n;j++)
	if(b[j]!=1)
		{
		flag=1;
		break;
		}
		if(flag==0)
			cout<<"Yes, I found it"<<endl;
		else 
			cout<<"It is impossible"<<endl;
}
		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