need help with a computer science problem (c++)........
Write a program that reads three strings and displays the strings in all possible sequences, one sequence per output line. Display the symbol * between the strings on each line.
Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.
Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.
Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
Not the answer you are looking for? Search for more explanations.
it says three strings, so probably just 3 "words", however strings is not necessary a word but it doesn't matter
I"m gonna have to back out of this one its time for dinner off the top of my head without writing any code i believe there are a minimum of 9 combinations.
I'd make a sudo logic table with as many combinations as i can think of and work off that.
no it's probably 6
first second third
first third second
second first third
second third first
third first second
third second first
however it doesn't say if you need to always use all of them, e.g. idk if you can print just one string or two strings
if len(head) == 0:
for i in range(len(head)):
for i in range(len(lst)-1):
print lst[i], '*',
if __name__ == '__main__':
#since this is Python, the obligatory one-liner, if you import itertools is:
#for w in list(itertools.permutations(['this','is','test'])): printit(w)
this is called a Permutations Algorithm, you have to search for it.
There's an entry in C++: http://rosettacode.org/wiki/Permutations#C.2B.2B
It uses lots of toys from C++ standard library though, so you might want to check out the entry on C: http://rosettacode.org/wiki/Permutations#C
agdgdgdgwngo .....thanks for those links permutations are a new method/concept for me but it mad my head spin with possible uses. Thanks again~!
thank you agdgdgdgwngo that was really helpfull, thanks all for helping
I think since there are only 3 strings they want them to do it manually, but yeah using that code is better since it works for all cases but even more better would be to create that code yourself