int main(){ int c; int tab[TAILLE]; int h[TAILLE]; int point[2]; point[0] = 0; point[1] = 400; printf("Initialisation de tab :\n"); c = init_tab(tab, TAILLE); printf("La valeur %d est presente %d fois.\n",V,compte(tab,c,V)); printf("La valeur maximale est : %d\n",max_notes(tab,c)); printf("\nTableau d'occurences :\n"); histogramme(tab,h,c); CINI_open_window(FENETRE,FENETRE,"fenetre"); CINI_fill_window("white"); /*dessiner_baton(point,50,100,"red"); */ printf("Dessiner histogramme\n:"); dessiner_histogramme(tab,h,point,c,20,100,"red"); return 0; }
/*Ce programme a pour but d'apprendre/comprendre *la gestion des nombres aléatoires et des tableaux *de plus un histogramme est réalisé */ int main() { int tab[DIM_TAB]; int histo[VAL_MAX]; int i; /*Init histogramme*/ for(i = 0 ; i < VAL_MAX ; i++) histo[i] = 0; srand(time(NULL));/*Création de la seed*/ init_alea_tab(tab);/*fonction d'init du tableau aléatoire*/ histogramme(tab,histo);/*création de l'histogramme*/ printf("Premier tableau :\n"); affiche_tab(tab); affiche_histo(histo); return EXIT_SUCCESS; }