Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- double NUMB_COLS = 3;
- void readMatrix(int matr[] [3], int numb_rows, int numb_cols)
- {
- for (int i = 0; i<numb_rows; i++)
- {
- for (int j = 0; j < numb_cols; j++)
- {
- cout <<"[" << i << "] [" <<j <<"] =";
- cin >> matr[i][j];
- }
- }
- }
- void printMatr(int matr[][3], int numb_rows, int numb_cols)
- {
- for (int i = 0; i < numb_rows; i++)
- {
- for (int j = 0; j < numb_cols; j++)
- {
- cout << "[" << i << "][" << j << "] = " << matr[i][j];
- }
- cout << endl;
- }
- }
- int main()
- {
- int matr[5][10];
- printMatr(matr, 4, 5);
- readMatrix(matr, 4, 5);
- return 0;
- }
- void readMatrix(int numb_rows, int numb_cols, int matr[numb_rows][numb_cols]) {
- void readMatrix(int matr[5][10], int numb_rows, int numb_cols)
- int matr[5][10];
- int matr[][3]
- int matr[][10];
- void printMatr(int matr[][10], int numb_rows, int numb_cols)
- int matr[5][3];
- printMatr(matr, 5, 3);
- readMatrix(matr, 5, 3);
- double NUMB_COLS = 3;
- const int NUMB_COLS = 3;
- #include<iostream>
- using namespace std;
- const int NUMB_COLS = 3;
- void readMatrix(int matr[] [NUMB_COLS], int numb_rows, int numb_cols)
- {
- for (int i = 0; i<numb_rows; i++)
- {
- for (int j = 0; j < numb_cols; j++)
- {
- cout <<"[" << i << "] [" <<j <<"] =";
- cin >> matr[i][j];
- }
- }
- }
- void printMatr(int matr[][NUMB_COLS], int numb_rows, int numb_cols)
- {
- for (int i = 0; i < numb_rows; i++)
- {
- for (int j = 0; j < numb_cols; j++)
- {
- cout << "[" << i << "][" << j << "] = " << matr[i][j];
- }
- cout << endl;
- }
- }
- int main()
- {
- int matr[5][NUMB_COLS];
- printMatr(matr, 5, NUMB_COLS);
- readMatrix(matr, 5, NUMB_COLS);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement