DEV/DEV1.1/tableaux/tableau_multidimensionel.c

28 lines
589 B
C
Raw Normal View History

2024-10-14 13:54:43 +02:00
#include <stdio.h>
#include <stdlib.h>
int main(void){
int t1 [2] [5] ={{1,2,3,4,5}, {1,2,3,4,5}};
int t2 [3] [5] ={{1,2,3,4,5}, {6,7,8,9,10}, {11,12,13,14,15}};
int t3 [5] [5] ={{0,0,0,0,0}, {1,0,0,0,0}, {1,2,0,0,0}, {1,2,3,0,0}, {1,2,3,4,0}};
int i;
for(i = 0; i < 10; i++){
printf(" | ");
printf("%d", t1[i]);
}
printf("\n");
for(i = 0; i < 15; i++){
printf(" | ");
printf("%d", t2[i]);
}
printf("\n");
for(i = 0; i < 25; i++){
printf(" | ");
printf("%d", t3[i]);
}
printf("\n");
}