There's this exercise that asks me to generate 5 random 3 digit numbers. The exercise requests that I generate those random numbers by using digits that are inputted by the user. Despite me not knowing how to explain, I could try to give an example:
std::cout << "a = ";
std::cin >> a;
std::cout << "b = ";
std::cin >> b;
std::cout << "c = ";
std::cin >> c;
I'll input the value of these integers (that have to be smaller than 10). Let's say a = 5; b = 3; c = 7. I need to generate 5 random 3 digit numbers using the values of a,b,c that the user puts in. I am allowed to use a, b and c only once when generating that number. Using the example above, this is how the numbers should look like: 537, 375, 357, 753, 735 (just an example, there are more possibilities). No numbers like 557, 533 etc. Can someone help? Thanks in advance.
Aucun commentaire:
Enregistrer un commentaire