25 lines
465 B
C
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;
|
||
|
}
|
||
|
|