解题思路:
注意事项:
参考代码:
#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语言训练-求1+2!+3!+...+N!的和 (C语言代码)浏览:2468 |
C二级辅导-计负均正 (C语言代码)浏览:647 |
简单的a+b (C语言代码)浏览:547 |
A+B for Input-Output Practice (III) (C语言代码)浏览:569 |
C语言程序设计教程(第三版)课后习题8.4 (C语言代码)浏览:619 |
wu-理财计划 (C++代码)浏览:827 |
printf基础练习2 (C语言代码)浏览:644 |
The 3n + 1 problem (C语言代码)浏览:548 |
C语言训练-亲密数 (C语言描述,反正怎么都能对)浏览:2155 |
Hello, world! (C语言代码)浏览:820 |