Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3.  
  4. using namespace std;
  5.  
  6. int main(){
  7.  
  8. const int betAmount {1};
  9. int bankaccount {0};
  10. char betnumber;
  11. int triestillzero {0};
  12. int n {0};
  13.  
  14.  
  15.  
  16. while(rand() % 37) {
  17.  
  18. if(rand() % 37 == 0) {
  19. cout << "You won" << bankaccount + 36.0 * betAmount;
  20.  
  21.  
  22. }else {
  23. cout << "You lost" << bankaccount - betAmount;
  24. }}
  25. cout << "you played " << +1 << "games and u won " << bankaccount << "Euro" << endl;
  26.  
  27. // wanna try again button instead of loop?
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement