DEV/DEV1.1/CM2/moyenne_main.c
Simoes Lukas 59f7eead89 A
2025-01-07 15:07:12 +01:00

14 lines
305 B
C

# include <stdio.h>
# include <stdlib.h>
# include "moyenne.h"
int main(int argc, char** argv) {
int i;
int* t = malloc(sizeof(int)*argc);
for (i = 0; i != argc-1; i++) {
t[i] = (int) strtol(argv[i+1], NULL, 10);
}
printf("Moyenne : %.2f\n", moyenne(t, argc-1));
free(t);
return EXIT_SUCCESS;
}