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 |
看看我的为什么不AC啊,求救(附代码)!!!!!!!!!!!!!!!!#include <stdio.h> #include <stdlib.h> #define max 1000 void main() { int i,j,digit[max],ones[max],k = 0,num[max],P,N,C,m = 0; for(i = 0; i < max; i++) num[i] = 0; while(1) { scanf("%d%d%d",&P,&N,&C); if(P == 0 && N == 0 && C == 0) break; ones[k] = 0; for(i = 0; i < N; i++) for(j = 0; j < P; j++) { scanf("%d",&digit[j]); if(digit[j] == 1) num[j]++; else { if(num[j] >= C) ones[k]++; num[j] = 0; } } for(i = 0; i < P; i++) if(num[i] >= C) { ones[k]++; num[i] = 0; } k++; } for(i = 0; i < k; i++) printf("%d\n",ones[i]); } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator