浙大计算机和软件学院,浙江大学计算机跟软件工程机试真题.pdf

这是一份2011年浙江大学计算机及软件学院的机试真题,主要涉及矩阵加法。题目要求读取两个矩阵A和B的元素,然后计算它们的和,并统计结果矩阵中零行和零列的数量。输入包含多个测试用例,每个用例由矩阵的行数M和列数N(不超过10)以及相应的矩阵元素组成。输出每个测试用例中零行和零列的总数。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

浙江大学计算机跟软件工程机试真题

本文档仅供学习和交流使用,任何组织和个人无权用于任何商业赢利活动!

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值