Question: Write a C++ program that will read one positive integer M supplied by the user, and your program should output the number of all

Write a C++ program that will read one positive integer M supplied

 

Write a C++ program that will read one positive integer M supplied by the user, and your program should output the number of all permutations of the digits, and the list of the permutations in an increasing order. If given input is 123 then your program should print an integer 6 with all 6 permutations in an increasing order e.g. 6 123 132 213 231 312 321 Note: If there are duplicated permutations, eliminate the duplicated one and only keep one permutations. For example, 121, will have 3 permutations which are 112 121 211. 11 If there are leading 0(s) in any permutation, eliminate the 0(s). For example, 120, will have permutations which are 12 21 102 120 201 210 Sample test case 3.1 Sample test case 3.2 123 6 123 132 213 231 312 321 Sample test case 3.3 121 3 112 121 211 Sample test case 3.4 120 6 12 21 102 120 201 210 Sample test case 3.5 100 3 1 10 100

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!