0

Hello friends,
there is yet another problem for you...
We have got a string say HOUR
Now we need a program that can choose the specified number of words say n from this word in all possible ways and displays them ...for example in this case
for n=3 the output should be
HOU
OUR
URH
RHO

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by Sci@phy
0

>there is yet another problem for you...
I've already solved that problem. Perhaps you meant to say "This is my homework".

>Now we need a program that can choose the specified number of
>words say n from this word in all possible ways and displays them
As much as it sounds like you want us to hand you the solution on a silver platter, I'll offer some advice. Do a google search for generating permutations. C++'s standard library has two functions that allow you to step through the permutations of a sequence, but I imagine your teacher wants you to do it manually.

0

And what have you done so far? :)

It's rather interesting:
n!/(x!*(n-x)!) different combinations, where n is size of string typed, and x is size of output strings

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.