Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <time.h>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- int arr[6],losowa;
- srand(time(NULL));
- for(int i=0;i<6;i++)
- {
- do{
- losowa=rand()%36+1;
- }while
- (
- losowa==arr[0]
- ||
- losowa==arr[1]
- ||
- losowa==arr[2]
- ||
- losowa==arr[3]
- ||
- losowa==arr[4]
- ||
- losowa==arr[5]
- );
- arr[i]=losowa;
- }
- for(int i=0;i<6;i++)
- {
- cout << arr[i] << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement