Untitled
raw download clone
CPP
views 14
,
size 532 b
#include <iostream>

using namespace std;

int n, m, a[101][101];

int main()
{
    cin >> n >> m;
    for(int i = 1; i <=n; i ++)
        for(int j =1 ; j <= m; j ++)
            cin>> a[i][j];
    for(int i = 1; i <= n; i ++)
    {
        for(int j = 0; j < m; j ++)
            a[i][j] = a[i][j + 1];
        a[i][m] = a[i][0];

    }



    for(int i = 1; i <= n; i ++)
    {
        for(int j = 1; j <= m; j ++)
            cout << a[i][j] << ' ' ;
        cout << endl;
    }
     return 0;
}
close fullscreen
Login or Register to edit or fork this paste. It's free.