24 lines
441 B
C
24 lines
441 B
C
#include<stdio.h>
|
|
#include<stdlib.h>
|
|
|
|
int main(int argc, char * argv[]) {
|
|
long val = 1;
|
|
int success = 0;
|
|
|
|
for (int i = 1; i < argc; i++) {
|
|
char * pointer;
|
|
|
|
long valeur = strtol(argv[i], &pointer, 10);
|
|
|
|
if (!(pointer == argv[i])) {
|
|
val *= valeur;
|
|
success++;
|
|
}
|
|
}
|
|
|
|
if (argc > 1 && success > 0) printf("Valeur : %ld\n", val);
|
|
else puts("Veuillez indiquer des entiers valides lors de l'exécution.");
|
|
return EXIT_SUCCESS;
|
|
}
|
|
|