APL/APL1.1/CMB1/histogramme.c
2021-10-26 14:42:06 +02:00

25 lines
465 B
C

#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#define SIZE_TABLE 20
int main(int argc, char * argv[]) {
int table[SIZE_TABLE] = {};
srand(time(NULL));
for (int i = 0; i < SIZE_TABLE; i++) { //On génère les valeurs aléatoires
srand(rand());
table[i] = rand() % 21;
}
for (int i = 0; i < SIZE_TABLE; i++) { //On créer l'histogramme
for (int count = 0; count < table[i]; count++) printf("");
printf("\n");
}
return EXIT_SUCCESS;
}