Guest User

Untitled

a guest
Jun 23rd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. #include <time.h>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. char apostar;
  9. char cDoagain;
  10.  
  11.  
  12. double fichas = 50;
  13. int fichasshow = 50;
  14.  
  15.  
  16. cout <<"Pressione S para apostar! "<< endl;
  17. cin >> apostar;
  18.  
  19. if (apostar == 's'|apostar == 'S')
  20. {
  21. do
  22. {
  23. system("clear");
  24.  
  25. int um;
  26. int dois;
  27. int tres;
  28.  
  29. um = (rand() % 4) + 1;
  30. dois = (rand() % 4) + 1;
  31. tres = (rand() % 4) + 1;
  32.  
  33. cout <<" __________________________ "<< endl;
  34. cout <<"| | | |"<< endl;
  35. cout <<"| | | |"<< endl;
  36. cout <<"| "<< um <<" | "<< dois <<" | "<< tres <<" |"<< endl;
  37. cout <<"| | | |"<< endl;
  38. cout <<"|________|________|________|"<< endl;
  39.  
  40. cout <<"FICHAS: "<< fichasshow << endl;
  41.  
  42.  
  43. if (um == dois == tres)
  44. {
  45. cout <<"PA-RA-BENS! VOCÊ GANHOU!!! "<< endl;
  46. cout <<"Você ganhou 15 fichas! "<< endl;
  47. fichas++;
  48. fichas++;
  49. fichas++;
  50. fichas++;
  51. fichas++;
  52. fichas++;
  53. fichas++;
  54. fichas++;
  55. fichas++;
  56. fichas++;
  57. fichas++;
  58. fichas++;
  59. fichas++;
  60. fichas++;
  61. fichas++;
  62. }
  63. else
  64. {
  65. fichasshow = fichas - 1;
  66. fichas = fichasshow;
  67. }
  68.  
  69. cout <<"Apostar de novo? (s ou n) "<< endl;
  70. cin >> cDoagain;
  71.  
  72. }while (cDoagain == 's'||cDoagain == 'S');
  73.  
  74. }
  75. }
Add Comment
Please, Sign In to add comment