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> #include<cstdio> using namespace std; int a[500][100]; int flag[500]={0}; int main(int argc, const char * argv[]) { int N,D; int b = 0; int c =0; int f = 0; while (scanf("%d%d",&N,&D)&&(N!=0)&&(D!=0)) { for(int i = 0;i<D;i++) for(int j = 0;j<N;j++) cin>>a[i][j]; for(int i = 0;i<D;i++) for(int j = 0;j<D;j++) { b =b+a[i][j]; if(b == N) { flag[i] = 1; } } for(int i = 0;i<D;i++) { c = c+flag[i]; if(c == 0); else { f =1;} } if(f == 1) printf("yes"); else printf("no"); b=0; c=0; f=0; for(int j = 0;j<D;j++) flag[j] =0; } // insert code here... //std::cout << "Hello, World!\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