浙江大学计算机跟软件工程机试真题
本文档仅供学习和交流使用,任何组织和个人无权用于任何商业赢利活动!
2011年浙江大学计算机及
软件学院机试真题
感谢王道会员手工录入了这份真题,任何组织和个人无权将其用于任何商业赢
利为目的的活动!
予人玫瑰,手有余香,王道论坛伴你一路同行!
第 1 页 共 16 页
本文档仅供学习和交流使用,任何组织和个人无权用于任何商业赢利活动!
A+B for Matrices (30)
Time Limit: 1 Second Memory Limit: 32768 KB
This time, you are supposed to find A+B where A and B are two matrices, and then count the number of
zero rows and columns.
Input
The input consists of several test cases, each starts with a pair of positive integers M and N (≤10) which
are the number of rows and columns of the matrices, respectively. Then 2*M lines follow, each contains
N integers in [-100, 100], separated by a space. The first M lines correspond to the elements of A and the
second M lines to that of B.
The input is terminated by a zero M and that case must NOT be processed.
Output
For each test case you should output in one line the total number of zero rows and columns of A+B.
Samp