Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int arr1[2][2];
- int arr2[2][2]{ {1,2}, {7,8} };
- int arr3[2][2]{ 1,2,7,8 };
- int arr4[3][3]{ {7,8}, {1,2,3} };
- const int row = 3; // количество строк
- const int col = 5; // количество столбцов
- int arr5[row][col];
- srand(time(NULL));
- for (int i = 0; i < row; i++) { // индекс строки
- for (int j = 0; j < col; j++) { // индекс столбца
- arr5[i][j] = rand() % 100;
- }
- }
- for (int i = 0; i < row; i++) {
- for (int j = 0; j < col; j++) {
- cout << arr5[i][j] << '\t';
- }
- cout << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment