56 lines
692 B
C
56 lines
692 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
int main(void){
|
|
/*
|
|
int tab[2][5];
|
|
int i;
|
|
int j;
|
|
for(i=0;i<2;i++){
|
|
for(j=1;j<=5;j++){
|
|
tab[i][j-1]=j;
|
|
}
|
|
}
|
|
for(i=0;i<2;i++){
|
|
for(j=0;j<5;j++){
|
|
printf("%d ",tab[i][j]);
|
|
}
|
|
printf("\n");
|
|
}
|
|
|
|
int tab[3][5];
|
|
int i;
|
|
int j;
|
|
int nb=1;
|
|
for(i=0;i<3;i++){
|
|
for(j=0;j<5;j++){
|
|
tab[i][j]=nb;
|
|
nb++;
|
|
}
|
|
}
|
|
for(i=0;i<3;i++){
|
|
for(j=0;j<5;j++){
|
|
printf("%d ",tab[i][j]);
|
|
}
|
|
printf("\n");
|
|
}
|
|
*/
|
|
int tab[5][5]={0};
|
|
int i;
|
|
int j;
|
|
int nb=0;
|
|
for(i=0;i<5;i++){
|
|
for(j=1;j<=nb;j++){
|
|
tab[i][j-1]=j;
|
|
}
|
|
nb++;
|
|
}
|
|
for(i=0;i<5;i++){
|
|
for(j=0;j<5;j++){
|
|
printf("%d ",tab[i][j]);
|
|
}
|
|
printf("\n");
|
|
}
|
|
|
|
return EXIT_SUCCESS;
|
|
} |