1234567891011121314151617181920212223242526272829303132 |
- #include <iostream>
- #include <math.h>
- using namespace std;
- int main()
- {
- const int tailleX(12);
- const int tailleY(7);
- int **tableau;
- tableau = new int*[tailleY];
- for (int i(0); i<tailleY; i++)
- tableau[i] = new int[tailleX];
- for (int i(0); i<tailleY*tailleX; i++)
- tableau[i/tailleX][i%tailleX] = i+10;
- for (int y(0); y < tailleY; y++)
- {
- for (int x(0); x < tailleX; x++)
- cout << tableau[y][x] << " ";
- cout << endl;
- }
- for (int i(0); i<tailleY; i++)
- delete[] tableau[i];
- delete[] tableau;
- tableau = 0;
- return 0;
- }
|