25 lines
405 B
C
25 lines
405 B
C
|
/* Matrice unitaire */
|
||
|
|
||
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
|
||
|
#define DIMENSION 4
|
||
|
|
||
|
|
||
|
int main() {
|
||
|
int matrice[DIMENSION][DIMENSION];
|
||
|
|
||
|
for (int i = 0; i < DIMENSION; i++) {
|
||
|
for (int j = 0; j < DIMENSION; j++) {
|
||
|
if (i == j) matrice[i][j] = 1;
|
||
|
else matrice[i][j] = 0;
|
||
|
printf("%d ", matrice[i][j]);
|
||
|
}
|
||
|
printf("\n");
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
return 0;
|
||
|
}
|