diff --git a/DEV1.1/TP06:Tableaux/TableauxMultidimensionnels/horizontal.c b/DEV1.1/TP06:Tableaux/TableauxMultidimensionnels/horizontal.c new file mode 100644 index 0000000..0d1c242 --- /dev/null +++ b/DEV1.1/TP06:Tableaux/TableauxMultidimensionnels/horizontal.c @@ -0,0 +1,75 @@ +#include +#include + +int main() { + int t1[2][5]; + int t2[3][5]; + int t3[5][5]; + int t4[5][2]; + int t5[5][3]; + int t6[5][5]; + int i; + int j; + int v; + printf(" t1 t2 t3 t4 t5 t6\n"); + for (i=0;i<5;i++){ + v=0; + if (i<2){ + for (j=0;j<5;j++){ + v++; + t1[i][j]=v; + printf("%d ",t1[i][j]); + } + } else{ + printf(" "); + } printf(" "); + v=0; + if (i<3){ + v=i*5; + for (j=0;j<5;j++){ + v++; + t2[i][j]=v; + printf("%2d ",t2[i][j]); + } + } else{ + printf(" "); + } printf(" "); + v=0; + for (j=0;j<5;j++){ + if (i>j){ + v=j+1; + t3[i][j]=v; + printf("%d ",t3[i][j]); + } else{ + v=0; + t3[i][j]=v; + printf("%d ",t3[i][j]); + } + } printf(" "); + v=0; + for (j=0;j<2;j++){ + v=i+1; + t4[i][j]=v; + printf("%d ",t4[i][j]); + } printf(" "); + v=i+1; + for (j=0;j<3;j++){ + t5[i][j]=v; + printf("%2d ",t5[i][j]); + v+=5; + } printf(" "); + v=0; + for (j=0;j<5;j++){ + if (i +#include + +int main() { + int t1[2][5]; + int t2[3][5]; + int t3[5][5]; + int t4[5][2]; + int t5[5][3]; + int t6[5][5]; + int i; + int j; + int v; + printf(" t1\n"); + for (i=0;i<2;i++){ + v=0; + for (j=0;j<5;j++){ + v++; + t1[i][j]=v; + printf("%d ",t1[i][j]); + } printf("\n"); + } printf("\n t2\n"); + v=0; + for (i=0;i<3;i++){ + for (j=0;j<5;j++){ + v++; + t2[i][j]=v; + printf("%2d ",t2[i][j]); + } printf("\n"); + } printf("\n t3\n"); + v=0; + for (i=0;i<5;i++){ + for (j=0;j<5;j++){ + if (i>j){ + v=j+1; + t3[i][j]=v; + printf("%d ",t3[i][j]); + } else{ + v=0; + t3[i][j]=v; + printf("%d ",t3[i][j]); + } + } printf("\n"); + } + printf(" t4\n"); + for (i=0;i<5;i++){ + for (j=0;j<2;j++){ + v=i+1; + t4[i][j]=v; + printf("%d ",t4[i][j]); + } printf("\n"); + } printf("\n t5\n"); + v=0; + for (i=0;i<5;i++){ + v=i+1; + for (j=0;j<3;j++){ + t5[i][j]=v; + printf("%2d ",t5[i][j]); + v+=5; + } printf("\n"); + } printf("\n t6\n"); + v=0; + for (i=0;i<5;i++){ + for (j=0;j<5;j++){ + if (i +#include + +int main() { + int Pas[30][30]; + int i; + int j; + Pas[0][0]=1; + Pas[1][0]=1; + Pas[1][1]=1; + printf("%3d\n%3d %3d\n",Pas[0][0],Pas[1][0],Pas[1][1]); + for (i=2;i<30;i++){ + Pas[i][0]=1; + Pas[i][i]=1; + printf("%3d ",Pas[i][0]); + for (j=1;j