48 lines
743 B
C
48 lines
743 B
C
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
|
||
|
int main(int argc, char * argv[]){
|
||
|
int grille[2][5],grille2[3][5],grille3[5][5];
|
||
|
int i,j,x=0;
|
||
|
// T1
|
||
|
for (i=0;i<2;i++){
|
||
|
for(j=0;j<5;j++){
|
||
|
grille[i][j]=j+1;
|
||
|
}
|
||
|
}
|
||
|
// T2
|
||
|
for (i=0;i<3;i++){
|
||
|
for(j=0;j<5;j++){
|
||
|
x++;
|
||
|
grille2[i][j]=x;
|
||
|
}
|
||
|
}
|
||
|
// T3
|
||
|
for (i=0;i<5;i++){
|
||
|
for (j=0;j<5;j++){
|
||
|
if (i <= j){
|
||
|
grille3[i][j]= 0;
|
||
|
}else{
|
||
|
grille3[i][j] = j+1;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
for (i=1;i<2;i++){
|
||
|
for(j=0;j<5;j++){
|
||
|
printf("%4d",grille[i][j]);
|
||
|
}
|
||
|
printf(" ");
|
||
|
for(j=0;j<5;j++){
|
||
|
printf("%4d",grille2[i][j]);
|
||
|
}
|
||
|
printf(" ");
|
||
|
for(j=0;j<5;j++){
|
||
|
printf("%4d",grille3[i][j]);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
printf("\n");
|
||
|
return EXIT_SUCCESS;
|
||
|
}
|