72 lines
918 B
C
72 lines
918 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
int main(void){
|
|
int tab1[2][5];
|
|
int i;
|
|
int j;
|
|
for(i=0;i<2;i++){
|
|
for(j=1;j<=5;j++){
|
|
tab1[i][j-1]=j;
|
|
}
|
|
}
|
|
for(i=0;i<2;i++){
|
|
for(j=0;j<5;j++){
|
|
printf("%d ",tab1[i][j]);
|
|
}
|
|
printf("\n");
|
|
}
|
|
|
|
int tab2[3][5];
|
|
int nb=1;
|
|
for(i=0;i<3;i++){
|
|
for(j=0;j<5;j++){
|
|
tab2[i][j]=nb;
|
|
nb++;
|
|
}
|
|
}
|
|
for(i=0;i<3;i++){
|
|
for(j=0;j<5;j++){
|
|
printf("%d ",tab2[i][j]);
|
|
}
|
|
printf("\n");
|
|
}
|
|
|
|
int tab3[5][5]={0};
|
|
nb=0;
|
|
for(i=0;i<5;i++){
|
|
for(j=1;j<=nb;j++){
|
|
tab3[i][j-1]=j;
|
|
}
|
|
nb++;
|
|
}
|
|
for(i=0;i<5;i++){
|
|
for(j=0;j<5;j++){
|
|
printf("%d ",tab3[i][j]);
|
|
}
|
|
printf("\n");
|
|
}
|
|
|
|
FILE *f;
|
|
f=fopen("t1.csv","w");
|
|
char tabOut[100];
|
|
nb=0;
|
|
char temp[]="0";
|
|
for(i=0;i<2;i++){
|
|
for(j=1;j<=5;j++){
|
|
temp[0]=tab1[i][j]+temp[0];
|
|
strcat(tabOut,temp);
|
|
}
|
|
printf("%s",tabOut);
|
|
tabOut[0]=0;
|
|
temp[0]="0";
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return EXIT_SUCCESS;
|
|
} |