Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <ctime>
- #include <random>
- #include <iomanip>
- using namespace std;
- int main()
- {
- srand (time(NULL));
- int n1,n2; cout << "value" << endl; cin >> n1 >> n2; //тут надо писать длину/ширину массива
- int **mas = new int *[n1];
- for (int cnt = 0; cnt < n1; cnt++)
- int *mas = new int[n2];
- for (int i = 0; i < n1; i++)
- for (int j = 0; j < n2; j++)
- mas[i][j] = rand() % 101;
- for (int i = 0; i < n1; i++)
- {
- cout << endl;
- for (int j = 0; j < n2; j++)
- {
- cout << setw(3) << mas[i][j] << " ";
- }
- }
- for (int i = 0; i < n1; i++)
- delete mas;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement