Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <ctime>
- #include <cstdlib>
- using namespace std;
- class a{
- int t[6];
- int ilosc;
- public:
- void losuj()
- {
- srand(time( NULL ));
- int a[ 6 ];
- int x;
- for( int i = 0; i < 6; i++ )
- {
- do
- {
- x =( rand() % 49 ) + 1;
- }
- while(( a[ 0 ] == x ) ||( a[ 1 ] == x ) ||( a[ 2 ] == x ) ||( a[ 3 ] == x ) ||( a[ 4 ] == x ) ||( a[ 5 ] == x ) );
- a[ i ] = x;
- cout << a[ i ] << "\n";
- }
- }
- };
- int main(int argc, char** argv){
- cout << "Wylosowano:\n\n";
- a p;
- p. losuj();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement