#include #include #include #include #include #include "Mot2.h" using std::string; //permet de permuter deux variables void permute(Mot2 tab[], int prem, int deux){ double stock=tab[prem].prob; tab[prem].prob=tab[deux].prob; tab[deux].prob=stock; int perm=tab[prem].ind; tab[prem].ind=tab[deux].ind; tab[deux].ind=perm; char car=tab[prem].lettre1; tab[prem].lettre1=tab[deux].lettre1; tab[deux].lettre1=car; car=tab[prem].lettre2; tab[prem].lettre2=tab[deux].lettre2; tab[deux].lettre2=car; } //permet de trier un tableau dans l'ordre décroissant void trier(Mot2 t[], int debut, int fin){ for(int pass=0;pass>a; is>>d; cc+=a; cc+=d; test=1; for(int ii=0;ii<676;ii++){ if(cc==c[ii]){ prob[ii]++; test=0; tot++; break; } } if(test==1){ c[num]+=a; c[num]+=d; prob[num]++; num++; tot++; } } for(int k=0;klim-taille;indice--){ dico[indice].code=dico[dico[indice].ind].code; } dico[indice+taille-1].code+="0"; dico[indice+taille].code+="1"; taille++; lim=indice; } double R=0; for(int lll=0;lll>b; is2>>e; for(int q=0;q