DEV/DEV1.1/tableaux/tableaux_multi.c
2024-10-22 15:14:54 +02:00

154 lines
3.0 KiB
C

#include <stdio.h>
#include <stdlib.h>
int main(void) {
int i,t1[2][5], t2[3][5], t3[5][5];
for (i=0; i<5;i++){
t1[0][i] = i+1;
printf("%2d ", t1[0][i]);
}
printf("\n");
for (i=0; i<5;i++){
t1[1][i] = i+1;
printf("%2d ", t1[1][i]);
}
printf("\n\n");
for (i=0; i<5;i++){
t2[0][i] = i+1;
printf("%2d ", t2[0][i]);
}
printf("\n");
for (i=5; i<10;i++){
t2[1][i] = i+1;
printf("%2d ", t2[1][i]);
}
printf("\n");
for (i=10; i<15;i++){
t2[2][i] = i+1;
printf("%2d ", t2[2][i]);
}
printf("\n\n");
for (i=0; i<5;i++){
t3[0][i] = 0;
printf("%2d ", t3[0][i]);
}
printf("\n");
for (i=0; i<1;i++){
t3[1][i] = i+1;
printf("%2d ", t3[1][i]);
}
for (i=1; i<5;i++){
t3[1][i] = 0;
printf("%2d ", t3[1][i]);
}
printf("\n");
for (i=0; i<2;i++){
t3[2][i] = i+1;
printf("%2d ", t3[2][i]);
}
for (i=2; i<5;i++){
t3[2][i] = 0;
printf("%2d ", t3[2][i]);
}
printf("\n");
for (i=0; i<3;i++){
t3[3][i] = i+1;
printf("%2d ", t3[3][i]);
}
for (i=3; i<5;i++){
t3[2][i] = 0;
printf("%2d ", t3[3][i]);
}
printf("\n");
for (i=0; i<4;i++){
t3[4][i] = i+1;
printf("%2d ", t3[4][i]);
}
for (i=4; i<5;i++){
t3[4][i] = 0;
printf("%2d ", t3[4][i]);
}
printf("\n");
return EXIT_SUCCESS;
}
/*int main(void) {
int i,t1[2][5], t2[3][5], t3[5][5];
for (i=0; i<5;i++){
t1[0][i] = i+1;
printf("%2d ", t1[0][i]);
}
printf (" ");
for (i=0; i<5;i++){
t2[0][i] = i+1;
printf("%2d ", t2[0][i]);
}
printf (" ");
for (i=0; i<5;i++){
t3[0][i] = 0;
printf("%2d ", t3[0][i]);
}
printf("\n");
for (i=0; i<5;i++){
t1[1][i] = i+1;
printf("%2d ", t1[1][i]);
}
printf (" ");
for (i=5; i<10;i++){
t2[1][i] = i+1;
printf("%2d ", t2[1][i]);
}
printf (" ");
for (i=0; i<2;i++){
t3[2][i] = i+1;
printf("%2d ", t3[2][i]);
}
for (i=2; i<5;i++){
t3[2][i] = 0;
printf("%2d ", t3[2][i]);
}
printf("\n");
printf(" ");
for (i=10; i<15;i++){
t2[2][i] = i+1;
printf("%2d ", t2[2][i]);
}
printf (" ");
for (i=0; i<3;i++){
t3[3][i] = i+1;
printf("%2d ", t3[3][i]);
}
for (i=3; i<5;i++){
t3[2][i] = 0;
printf("%2d ", t3[3][i]);
}
printf("\n");
printf(" ");
printf(" ");
printf(" ");
for (i=0; i<4;i++){
t3[4][i] = i+1;
printf("%2d ", t3[4][i]);
}
for (i=4; i<5;i++){
t3[4][i] = 0;
printf("%2d\n ", t3[4][i]);
}
return EXIT_SUCCESS;
}*/