Advertisement
Guest User

lotto

a guest
Aug 16th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3. #include <ctime>
  4. #include <cstdlib>
  5. using namespace std;
  6.  
  7.  
  8.  
  9. int main()
  10. {
  11. int ilosc = 6;
  12. int maks_liczba = 49;
  13. int wylosowane[6];
  14. int i,liczba;
  15.  
  16. cout<<"Lotto!"<<endl<<"Komora losowania jest pusta. Nacisnij enter aby zwolnic blokade."<<endl;
  17. getch();
  18. cout<<"Nastepuje zwolnienie blokady..."<<endl;
  19.  
  20. for(i=0;i<ilosc;i++)
  21. {
  22. srand (static_cast<unsigned int>(time(NULL)));
  23. liczba=rand() % maks_liczba+1;
  24. wylosowane[i]=liczba;
  25. liczba=0;
  26.  
  27.  
  28. }
  29. cout<<"Wylosowane liczby to: ";
  30. int j;
  31. for(j=0;j<ilosc;j++)
  32. {
  33. cout<<wylosowane[j]<<" , ";
  34. }
  35.  
  36.  
  37.  
  38. getch();
  39. return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement