Probleme d'affichage

Fermé
hichem - 16 nov. 2015 à 22:08
Bonjour,



j'ai une probleme aux niveau d'affichage pour mon programme ,

#include <iostream>
#include<ctime>
#include<cstdlib>
#include<string>

using namespace std;

string melongeMot (string mot )
{
int position(0);
string melange;
while (mot.size()!=0)
{

position=rand()%mot.size();
melange+=mot[position];
mot.erase(position,1);
return melange;
}
}

int main()
{

string motMystere,motUtilisateur,motMelanger,mot;
cout<< "entrer le mot Mystere "<<endl;
cin>>motMystere;
srand(time(0));
motMelanger = melongeMot(motMystere);
do
{
cout<<"donner votre essai a partir de "<< motMelanger <<endl;

//ici il affiche juste le premier caractere de mot????????????????


cin>>motUtilisateur;
if (motUtilisateur == motMystere)
{
cout<<"bravo"<<endl;
}
else {cout<<"malheureusement c'est faut, tu doit rechercher"<<endl;}
}
while (motUtilisateur != motMystere);


return 0;
}