Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- int main()
- {
- int rows, cols;
- std::cout << "Number of rows: ";
- std::cin >> rows;
- std::cout << "Number of columns: ";
- std::cin >> cols;
- int** array = new int *[rows];
- for (int i = 0; i < rows; ++i)
- array[i] = new int[cols];
- std::cout << "Enter\n";
- for (int i = 0; i < rows; i++)
- {
- for (int j = 0; j < cols; j++)
- {
- std::cin >> array[i][j];
- }
- }
- std::cout << "Your array:" << std::endl;
- for (int i = 0; i < rows; i++)
- {
- for (int j = 0; j < cols; j++)
- {
- std::cout << array[i][j] << " ";
- }
- std::cout << "\n";
- }
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement