解题思路:
注意事项:
参考代码:
#include <cstdio> #include <cstdlib> #include <iostream> #include <cmath> #include <cctype> #include <cstring> #include <string> #include <algorithm> #include <functional> using namespace std; const int maxn=101; int a[maxn][maxn], b[maxn][maxn]; int main() { int N, M; scanf("%d%d", &N, &M); for(int i = 0; i < N; ++i) { for(int j = 0; j < M; ++j) { scanf("%d", &a[i][j]); } } for(int i = 0; i < N; ++i) { for(int j = 0; j < M; ++j) { scanf("%d", &b[i][j]); a[i][j] += b[i][j]; } } for(int i = 0; i < N; ++i) { for(int j = 0; j < M; ++j) { printf("%d", a[i][j]); if(j != M-1) { printf(" "); } } printf("\n"); } return 0; }
0.0分
0 人评分
C二级辅导-温度转换 (C语言代码)浏览:2341 |
C语言训练-舍罕王的失算 (C++代码)(都给答案了还算什么)浏览:972 |
C二级辅导-求偶数和 (C语言代码)浏览:629 |
C二级辅导-公约公倍 (C语言代码)浏览:2122 |
C语言程序设计教程(第三版)课后习题1.6 (C语言代码)浏览:584 |
数组输出 (C语言代码)--此题的题目描述有问题浏览:1817 |
2003年秋浙江省计算机等级考试二级C 编程题(2) (C语言代码)浏览:751 |
printf基础练习2 (C语言代码)浏览:741 |
C二级辅导-阶乘数列 (C语言代码)浏览:691 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:1162 |