Răspuns :
#include <iostream>
using namespace std;
int main()
{
int n,m, i, j, A[50][50];
cin >> n>>m;
for (i = 1; i <= n; i++)
{
for (j = 0; j <= m; j++)
{
if (i<j)
A[i][j] = i;
else
A[i][j] = j;
}
}
for (i = 1; i <= n; i++)
{
for (j = 1; j <= m; j++)
cout << A[i][j] << " ";
cout << endl;
}
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int n,m, i, j, A[25][25];
cin >> n>>m;
for (i = 1; i <= n; i++)
{
for (j = 0; j <= m; j++)
{
if (i<j)
A[i][j] = i;
else
A[i][j] = j;
}
}
for (i = 1; i <= n; i++)
{
for (j = 1; j <= m; j++)
cout << A[i][j] << " ";
cout << endl;
}
return 0;
}