1001 A+B for Matrices 九度Online Judge
2013-04-17 18:50
337 查看
#include<iostream> using namespace std; int main() { int a,b,m[15][15],n[15][15],t,count; while(cin>>a&&a) { cin>>b; count=0; for(int i=0; i<a; i++) { for(int j=0; j<b; j++) { cin>>m[i][j]; } } for(int i=0; i<a; i++) { for(int j=0; j<b; j++) { cin>>n[i][j]; } } for(int i=0; i<a; i++) { t=0; for(int j=0; j<b; j++) { if(m[i][j]+n[i][j]) { t=1; break; } } if(t==0) count++; } for(int i=0; i<b; i++) { t=0; for(int j=0; j<a; j++) { if(m[j][i]+n[j][i]) { t=1; break; } } if(t==0) count++; } cout<<count<<endl; } return 0; }
相关文章推荐
- 题目 1001 A+B for Matrices 九度Online Judge
- 题目1001:A+B for Matrices
- 题目1001:A+B for Matrices
- 1001—A+B for Matrices
- 九度OJ 1001 A+B for Matrices
- 题目1001:A+B for Matrices
- 1001 A+B for Matrices
- A+B for Matrices_1001
- 九度1001 A+B for Matrices
- 题目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
- 九度OJ-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