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 <stdio.h> int x[1000][1000]; int main() { int p,n,c;int i,j,sum,flag; while (EOF!=scanf("%d %d %d",&p,&n,&c)) { int k=0; if (p==0&&n==0&&c==0) break; for (i=0;i<n;i++) { for (j=0;j<p;j++) scanf("%d",&x[i][j]); } for (j=0;j<p;j++) { sum=0; for (i=0;i<n;i++) { flag=sum; sum=sum+x[i][j]; if (sum>flag) { if (i==n-1&&sum>=c) {k++;sum=0;} else if (i!=n-1) continue; } else if (sum>=c) { k++;sum=0;} else sum=0; } } printf("%d\n",k); } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator