I have to take in a a string and scramble it 5 times, using string methods. I have to separate it using 2 radnom num's, and into three parts. It won't execute for some reason. Any help will be appreciated. Here's the code:
cout<
cout<<"Enter a phrase to shuffle: ";
getline(cin,phrase_input);
for(int i = 0;i <= 5;i++)
{
beg = phrase_new.substr(0,random_one);
mid = phrase_new.substr(random_one,random_two - random_one);
endphr = phrase_new.substr(random_two,phr_len - random_two);
shuffled_phrased+= endphr;
shuffled_phrased+= beg;
shuffled_phrased+= mid;
}
cout<
2007-01-27
08:02:35
·
2 answers
·
asked by
Anonymous
in
Computers & Internet
➔ Programming & Design