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 |
为什么wa?#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator