Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int RandNum(int firstNum, int secondNum, int thirdNum) {
- int initialRandInt = rand() % 10;
- firstNum = initialRandInt;
- secondNum = initialRandInt;
- thirdNum = initialRandInt;
- while ( secondNum == firstNum ) {
- secondNum = rand() % 10;
- }
- while ( thirdNum == firstNum || thirdNum == secondNum ) {
- thirdNum = rand() % 10;
- }
- return firstNum, secondNum, thirdNum;
- }
- int firstNum;
- int secondNum;
- int thirdNum;
- RandNum(firstNum, secondNum, thirdNum);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement