Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #define MAXN 10
- using namespace std;
- void input_2d(int &n, int &m, int a[][MAXN]) {
- cin >> n >> m;
- for (int i = 0; i < n; i++) {
- for (int j = 0; j < m; j++) {
- cin >> a[i][j];
- }
- }
- }
- void output_2d(int &n, int &m, int a[][MAXN]) {
- for (int i = 0; i < n; i++) {
- for (int j = 0; j < m; j++) {
- cout << a[i][j] << " ";
- }
- cout << endl;
- }
- }
- int main() {
- int a[MAXN][MAXN], n, m;
- input_2d(n, m, a);
- output_2d(n, m, a);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment