Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
老是错!唉!#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator