Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int main()
- {
- const int arrSizeY{ 3 };
- const int arrSizeX{ 4 };
- const int mult{2};
- int arr[arrSizeY][arrSizeX];
- std::cout << "First number = ";
- std::cin >> arr[0][0];
- for (int y{ 0 }; y < arrSizeY; ++y)
- {
- if( y > 0)
- {
- arr[y][0] = arr[y-1][arrSizeX-1]*mult;
- }
- std::cout << arr[y][0] << ' ';
- for (int x{ 1 }; x < arrSizeX; ++x)
- {
- arr[y][x] = arr[y][x-1] * mult;
- std::cout << arr[y][x] << ' ';
- }
- std::cout << '\n';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement