You are to write a program which takes in a pair of positive integers, n and m ,
ID: 3536392 • Letter: Y
Question
You are to write a program which takes in a pair of positive integers, n and m,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
(0 < m _ n < 20), and outputs all the possible permutations of choosing m integers from the set f {1, 2, %u2026 , n}. The input is just one line with two integers separated by a white space. The output should print one permutation per line, and a final line containing the number of permutations printed.
Important:
Your program should prompt the user for input, and it should accept only valid input. Your output should be organized as follows:
Sample Input Sample Output
3 2 1 2
1 3
2 1
2 3
3 1
3 2
6