Salut. Uite aici rezolvarea problemei. Succes in continuare!
#include <iostream>
using namespace std;
int main()
{
int i, j, n;
int v[16][16];
cin >> n;
for (i = 1; i <= n; i++)
{
v[1][i] = i + 1;
v[n][i] = n + i;
v[i][1] = i + 1;
v[i][n] = n + i;
}
for (i = 2; i < n; i++)
{
for (j = 2; j < n; j++)
{
v[i][j] = v[i - 1][j - 1] + v[i - 1][j] + v[i - 1][j + 1];
}
}
for (i = 1; i <= n; i++)
{
for (j = 1; j <= n; j++)
cout << v[i][j] << " ";
cout << endl;
}
return 0;
}