57 lines
858 B
C
57 lines
858 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=0;i<5;i++){
|
|
for(j=0;j<5;j++){
|
|
if (i<2) {
|
|
printf("%4d",grille[i][j]);
|
|
}else{
|
|
printf(" 0");
|
|
}
|
|
}
|
|
printf(" ");
|
|
for(j=0;j<5;j++){
|
|
if (i<2){
|
|
printf("%4d",grille2[i][j]);
|
|
}else{
|
|
printf(" 0");
|
|
}
|
|
}
|
|
printf(" ");
|
|
for(j=0;j<5;j++){
|
|
printf("%4d",grille3[i][j]);
|
|
}
|
|
printf("\n");
|
|
}
|
|
|
|
|
|
printf("\n");
|
|
return EXIT_SUCCESS;
|
|
}
|