jal пре 5 година
родитељ
комит
4b091fc2a7
1 измењених фајлова са 27 додато и 0 уклоњено
  1. 27 0
      B.cpp

+ 27 - 0
B.cpp

@@ -0,0 +1,27 @@
+#include<bits/stdc++.h>
+using namespace std;
+int main(){
+    int n,m;
+    cin >> n >> m;
+    int a[n][m], b[n][m], c[n][m];
+    for(int i = 0; i < n; i++){
+        for(int j = 0; j < m; j++){
+            cin >> a[i][j];
+        }
+    }
+
+    for(int i = 0; i < n; i++){
+        for(int j = 0; j < m; j++){
+            cin >> b[i][j];
+            c[i][j] = a[i][j] + b[i][j];
+        }
+    }
+
+    for(int i = 0; i < n; i++){
+        for(int j = 0; j < m-1; j++){
+            cout << c[i][j] << " ";
+        }
+        cout << c[i][m-1] << endl;
+    }
+    return 0;
+}