33 lines
493 B
C
33 lines
493 B
C
|
#include <stdio.h>
|
||
|
|
||
|
#define N 3
|
||
|
|
||
|
int main () {
|
||
|
|
||
|
|
||
|
// int A[N][N] = {1,2,3,4,5,6,7,8,9}; // Initialisation pas magique
|
||
|
int A[N][N] = {4,2,3,2,3,4,3,4,2}; // Initialisation pas magique
|
||
|
void affiche (int, int tab[N][N]);
|
||
|
|
||
|
affiche(N,A);
|
||
|
|
||
|
return 1;
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
void affiche(int n, int tab[n][n]) { // affiche les 4 elements
|
||
|
int i;
|
||
|
int j;
|
||
|
for(i=0;i<n;i=i+1)
|
||
|
{
|
||
|
for(j=0;j<n;j++)
|
||
|
{
|
||
|
printf("%d\t",tab[i][j]);
|
||
|
}
|
||
|
printf("\n"); // pour sauter de ligne
|
||
|
}
|
||
|
return;
|
||
|
}
|