九度1001 A+B for Matrices
2012-06-23 18:06
302 查看
/********************************* * 日期:2012-6-23 * 作者:SJF0115 * 题号: 九度1001 * 题目:A+B for Matrices * 结果:AC * 题意: * 总结: **********************************/ #include<stdio.h> int main(){ int M,N; int Matrices[11][11]; while(scanf("%d",&M),M){ scanf("%d",&N); int i,j; for(i = 0;i<M;i++){ for(j = 0;j<N;j++){ scanf("%d",&Matrices[i][j]); } } int a; int count = 0; int CountOfZero = 0; for(i = 0;i<M;i++){ for(j = 0;j<N;j++){ scanf("%d",&a); Matrices[i][j] += a; count += Matrices[i][j]; } if(count == 0){ CountOfZero++; } count = 0; } //计算列 count = 0; for(i = 0;i<N;i++){ for(j = 0;j<M;j++){ count += Matrices[j][i]; } if(count == 0){ CountOfZero++; } count = 0; } printf("%d\n",CountOfZero); } return 0; }
相关文章推荐
- 【九度OJ】题目1001:A+B for Matrices
- 九度OJ题目1001:A+B for Matrices
- 九度OJ-1001:A+B for Matrices
- 九度oj-1001-A+B for Matrices
- 九度题目1001:A+B for Matrices
- 九度1001 A+B for Matrices
- 九度 题目1001:A+B for Matrices
- 九度 题目1001:A+B for Matrices
- 九度 OJ1001:A+B for Matrices
- 1001 A+B for Matrices
- 题目1001:A+B for Matrices
- 题目1001:A+B for Matrices
- 题目1001:A+B for Matrices
- 题目1001:A+B for Matrices
- 题目1001:A+B for Matrices
- 题目1001:A+B for Matrices
- 1001—A+B for Matrices
- 九度OJ 1001 A+B for Matrices
- 九度oj 题目1001:A+B for Matrices 【ZJU2011考研机试题1】
- 九度OJ—题目1001:A+B for Matrices