cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
random string
random string
Apr 24, 2018 at 2:55am UTC
Emanuelle23
(1)
somebody can help me to make program like this ?
Input :
HAI
BKA
ADA
Output :
AHI, AIH, HAI, HIA, IAH, IHA
ABK, AKB, BAK, BKA, KAB, KBA
AAD, ADA, AAD, ADA, DAA, DAA
using recursion data structure
Last edited on
Apr 24, 2018 at 2:58am UTC
Apr 24, 2018 at 3:47am UTC
Uk Marine
(432)
Show your attempt and people might.
Apr 24, 2018 at 7:22am UTC
keskiverto
(10399)
1. You want to read each word separately.
http://www.cplusplus.com/doc/tutorial/basic_io/
http://www.cplusplus.com/reference/string/string/operator%3E%3E/
2. You want to sort characters in a word. This gets you the first word of each output line.
http://www.cplusplus.com/reference/algorithm/sort/
3. You want to shuffle the characters some more.
http://www.cplusplus.com/reference/algorithm/next_permutation/
You will need loops too.
http://www.cplusplus.com/doc/tutorial/control/
EDIT: A recursion? A loop can be converted into recursion. However, I guess you know better what "recursion data structure" means.
Topic archived. No new replies allowed.