九度oj1001题
来源:互联网 发布:用python做科学计算pdf 编辑:程序博客网 时间:2024/05/20 09:06
#include <iostream>#include <cstdio>#include <string>using namespace std;#define N 10#define size 1024int main(){int i, j, total = 0;short a[N][N] = { 0 }, b[N][N] = { 0 }, c[N][N] = { 0 }, t[N] = {0};while (1){cin >> i;if (i == 0)break;cin >> j;for (int m = 0; m < i; ++m){for (int n = 0; n < j; ++n){cin >> a[m][n];}}for (int m = 0; m < i; ++m){for (int n = 0; n < j; ++n){cin >> b[m][n];}}for (int m = 0; m < i; ++m){for (int n = 0; n < j; ++n){c[m][n] = a[m][n] + b[m][n];}}for (int m = 0; m < i; ++m){int flag = 1;for (int n = 0; n < j; ++n){if (c[m][n]){flag = 0;break;}}if (flag == 1)t[total]++;}for (int m = 0; m < j; ++m){int flag = 1;for (int n = 0; n < i; ++n){if (c[n][m]){flag = 0;break;}}if (flag == 1)t[total]++;}total++;}for (int index = 0; index < total; ++index){cout << t[index] << endl;}}
0 0
- 九度oj1001题
- 九度oj1001
- 九度OJ1001
- 九度 OJ1001:A+B for Matrices
- oj1001
- 杭电oj1001题 a+b
- 东秦oj1001
- 北大OJ1001
- ZZULI-OJ1001
- 百炼OJ1001
- A+B for Matrices OJ1001
- 九度oj1002题
- 九度oj1003题
- 九度oj1004题
- 九度oj1005题
- 杭电oj1001排序 交换次数
- 九度oj 1001题
- 九度oj题 题目1000
- 使用Intent启动Activity
- drawleft,textview、EditText中图片大小设置
- Linux中使用crontab命令启用自定义定时任务
- oracle 非正常关闭下的数据库无法启动
- Eclipse快捷键大全,导包快捷键:ctrl+Shift+O
- 九度oj1001题
- 一般将absolute元素的父元素设为relative
- shell脚本中expect交互应用2017.1.10
- 微服务(Microservice)那点事
- Win7、Ubuntu双系统删除Ubuntu后启动no such partition grub rescue错误
- 算法提高 简单计算器
- ubuntu交叉编译试用于openwrt的i2c-tools
- CSS继承性的研究
- Java实现SHA-256签名加密