#include #include #include "ligne.h" static void usage(char * nom_commande); static void usage(char * nom_commande) { fprintf(stderr, "Usage: %s longueur_ligne nombre_de_mots\n", nom_commande); exit(EXIT_FAILURE); } int main(int argc, char *argv[]) { int i; if (argc != 3) { usage(argv[0]); } ligne_fixer_longueur(atoi(argv[1])); for (i = 0; i < atoi(argv[2]); i++) { switch(rand() % 4) { case 0 : ligne_ecrire("zero, "); break; case 1 : ligne_ecrire("un, "); break; case 2: ligne_ecrire("deux, "); break; case 3: ligne_ecrire("trois, "); break; default: ligne_ecrire("etc. "); break; } } ligne_ecrire("\n"); return EXIT_SUCCESS; }