55 lines
861 B
C
55 lines
861 B
C
# include <stdio.h>
|
|
# include <stdlib.h>
|
|
|
|
int main(void) {
|
|
/* Déclaration des tableaux */
|
|
int t1[2][5];
|
|
int t2[3][5];
|
|
int t3[5][5];
|
|
FILE* fichier = NULL;
|
|
int compteur;
|
|
/* Remplissage des tableaux */
|
|
int i;
|
|
int j;
|
|
/* t1 */
|
|
for (i = 0; i != 2; i++) {
|
|
for (j = 0; j != 5; j++) {
|
|
t1[i][j] = j + 1;
|
|
}
|
|
}
|
|
/* t2 */
|
|
compteur = 1;
|
|
for (i = 0; i != 3; i++) {
|
|
for (j = 0; j != 5; j++) {
|
|
t2[i][j] = compteur;
|
|
compteur++;
|
|
}
|
|
}
|
|
/* t3 */
|
|
compteur = 0;
|
|
for (i = 0; i != 5; i++) {
|
|
for (j = 0; j != 5; j++) {
|
|
if (j >= i) {
|
|
t3[i][j] = 0;
|
|
}
|
|
else {
|
|
t3[i][j] = 1 + j;
|
|
}
|
|
}
|
|
}
|
|
|
|
fichier = fopen("t1.csv", "w");
|
|
if (fichier == NULL) {
|
|
printf("Erreur d'ouverture.\n");
|
|
return EXIT_FAILURE;
|
|
}
|
|
|
|
for (i = 0; i != 2; i++) {
|
|
for (j = 0; j != 2; j++) {
|
|
fputs(/* TODO */)
|
|
}
|
|
}
|
|
fclose(fichier);
|
|
|
|
return EXIT_SUCCESS;
|
|
} |