Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <ctime>
- #include <cstring>
- class Monte {
- public:
- void shuffle(char** Doors, int n) {
- char** tempDoor;
- srand(time(NULL));
- for (int i = n - 1; i > 0; i--) {
- int j = rand() % (i + 1);
- tempDoor[i] = Doors[i];
- Doors[i] = Doors[j];
- Doors[j] = tempDoor[i];
- }
- };
- void printDoors(char** Doors) {
- std::cout << Doors[0] << " " << Doors[1] << " " << Doors[2];};
- };
- int main() {
- Monte test;
- char** Doors;
- strcpy(Doors[0], "Car");
- strcpy(Doors[1], "Goat");
- strcpy(Doors[2], "Goat");
- test.printDoors(Doors);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement