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(time(NULL));
- do{
- gen[i] = rand() % 9+1;
- i++;
- }while((gen[1]==gen[2])or(gen[2]==gen[3])or(gen[1]==gen[3])or(gen[1]==gen[4])
- or(gen[3]==gen[4])or(gen[4]==gen[2]));
- cout<<gen[1]<<gen[2]<<gen[3]<<gen[4];
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement