| | |
Permutation with conditions.
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2006
Posts: 2
Reputation:
Solved Threads: 0
Ok the program required to enter n numbers of distinct girls and m number of distinct boys. Then it produce a list of every possible way the boys and girls can be on a line if two girls can stand on the line together..
Example
m = 1 (number of boys)
n = 2 (number of girls)
all accepted permutations will be
N1, M1, N2
N2, M1, N1
it cant accept
M1, N1, N2
M1, N2, N1
N1, N2, M1
N2, N1, M1
Because two 'girls' are together
Example
m = 1 (number of boys)
n = 2 (number of girls)
all accepted permutations will be
N1, M1, N2
N2, M1, N1
it cant accept
M1, N1, N2
M1, N2, N1
N1, N2, M1
N2, N1, M1
Because two 'girls' are together
![]() |
Other Threads in the C++ Forum
- Previous Thread: extremely newbie errors in GCC C
- Next Thread: Can somebody help explain this problem?
| Thread Tools | Search this Thread |
api array arrays based binary c++ c/c++ calculator char char* class classes code coding compile console conversion convert count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






