#include #include using namespace std; /* Remplir et afficher un tableau */ int main(){ const int d1 = 10, d2 = 9; int** mat; int i, j; mat = (int**)malloc(d1 * sizeof(int*)); for (i = 0; i < d1; i++){ mat[i] = (int*)malloc(d2 * sizeof(int)); for (j = 0; j < d2; j++) if (j == 0 || j == d2-1) mat[i][j] = i; else if (i == d1-1 || (j == 4 && i > 1)) mat[i][j] = 9; else mat[i][j] = 0; } for (i = 0; i < d1; i++){ for (j = 0; j < d2; j++) cout << mat[i][j]; cout << endl; } for (i = 0; i < d1; i++) free(mat[i]); free(mat); return 0; }