Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int a,temp;
- const int n = 2, m = 6;
- int massiv[n][m]{ { 1,2,3,4,5,6 },{ 7,8,9,10,11,12 } };
- cout << "На сколько шагов сдвиг влево? ";
- cin >> a;
- for (int i = 0; i < a; i++) {
- for (int j = 0; j < n; j++) {
- temp = massiv[j][0];
- for (int g = 0; g < m-1; g++)
- massiv[j][g] = massiv[j][g+1];
- massiv[j][m - 1] = temp;
- }
- }
- for (int i = 0; i < n; i++) {
- for (int j = 0; j < m; j++)
- cout << massiv[i][j] << " ";
- cout << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement