Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- #include <ctime>
- #include <cstdlib>
- using namespace std;
- int main()
- {
- int ilosc = 6;
- int maks_liczba = 49;
- int wylosowane[6];
- int i,liczba;
- cout<<"Lotto!"<<endl<<"Komora losowania jest pusta. Nacisnij enter aby zwolnic blokade."<<endl;
- getch();
- cout<<"Nastepuje zwolnienie blokady..."<<endl;
- for(i=0;i<ilosc;i++)
- {
- srand (static_cast<unsigned int>(time(NULL)));
- liczba=rand() % maks_liczba+1;
- wylosowane[i]=liczba;
- liczba=0;
- }
- cout<<"Wylosowane liczby to: ";
- int j;
- for(j=0;j<ilosc;j++)
- {
- cout<<wylosowane[j]<<" , ";
- }
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement