50 lines
788 B
C
50 lines
788 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;
|
|
}
|
|
}
|
|
for (i=0;i<2;i++){
|
|
for(j=0;j<5;j++){
|
|
printf("%4d",grille[i][j]);
|
|
}printf("\n");
|
|
}
|
|
printf("\n");
|
|
// T2
|
|
for (i=0;i<3;i++){
|
|
for(j=0;j<5;j++){
|
|
x++;
|
|
grille2[i][j]=x;
|
|
}
|
|
}
|
|
for (i=0;i<3;i++){
|
|
for(j=0;j<5;j++){
|
|
printf("%4d",grille2[i][j]);
|
|
}printf("\n";
|
|
}
|
|
printf("\n");
|
|
// 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++){
|
|
printf("%4d",grille3[i][j]);
|
|
}printf("\n");
|
|
}
|
|
|
|
return EXIT_SUCCESS;
|
|
}
|