Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <ctime>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- srand(static_cast<unsigned>(time(nullptr)));
- // tworzymy tablice z szescioma elementami:
- unsigned tablica[6];
- // dla kazdej pozycji w tabeli losujemy liczbe z przedzialu od 1 do 49:
- for(unsigned i = 0; i < 6; ++i)
- tablica[i] = 1 + rand() % 49;
- // wypisujemy wylosowane liczby na ekran:
- for(unsigned i = 0; i < 6; ++i)
- cout << tablica[i] << '\t';
- cout << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement