Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ctime>
- #include <iostream>
- using namespace std;
- int gen[4];
- int main()
- {
- int i=0;
- srand((unsigned)time(NULL));
- do{
- i++;
- gen[i] = rand() % 9+1;
- }while((gen[1]!=gen[2])and(gen[2]!=gen[3])and(gen[1]!=gen[3])and(gen[1]!=gen[4])
- and(gen[3]!=gen[4]) and(gen[4]!=gen[2]));
- cout<<gen[1,2,3,4];
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement