Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. #include <conio.h>
  4. #include <Windows.h>
  5.  
  6. int main()
  7. {
  8.  
  9. int pestininkai = 0;
  10. int sunkieji = 0;
  11. int sauliai = 0;
  12. int pagalbiniai = 0;
  13. int pinigai = 0;
  14.  
  15. while (true)
  16. {
  17. system ("cls");
  18.  
  19. pinigai = pinigai + 10;
  20.  
  21. cout << "Jus turite pinigu: " << pinigai << endl;
  22. cout << "***************************" << endl;
  23. if (GetAsyncKeyState( '1' ))
  24. {
  25. pinigai = pinigai - 10;
  26.  
  27. if (pinigai<0)
  28. {
  29.  
  30. cout << "Atleiskit taciau siuo metu Jus neturite tiek pinigu" << endl;
  31. pinigai = pinigai + 10;
  32. }
  33. else
  34. pestininkai++;
  35.  
  36.  
  37.  
  38. }
  39. if (GetAsyncKeyState( '2' ))
  40. {
  41.  
  42. pinigai = pinigai - 20;
  43.  
  44. if (pinigai<0)
  45. {
  46.  
  47. cout << "Atleiskit taciau siuo metu Jus neturite tiek pinigu" << endl;
  48. pinigai = pinigai + 20;
  49.  
  50. }
  51. else
  52. sunkieji++;
  53. }
  54. if (GetAsyncKeyState( '3' ))
  55. {
  56.  
  57. pinigai = pinigai - 30;
  58. if (pinigai<0)
  59. {
  60.  
  61. cout << "Atleiskit taciau siuo metu Jus neturite tiek pinigu" << endl;
  62. pinigai = pinigai + 30;
  63.  
  64. }
  65. else
  66. sauliai++;
  67. }
  68. if (GetAsyncKeyState( '4' ))
  69. {
  70.  
  71. pinigai = pinigai - 40;
  72. if (pinigai<0)
  73. {
  74.  
  75. cout << "Atleiskit taciau siuo metu Jus neturite tiek pinigu, kad galetumet nuspirkti Pagalbininka" << endl;
  76. pinigai = pinigai + 40;
  77.  
  78. }
  79. else
  80. pagalbiniai++;
  81. }
  82. cout << "***************************" << endl;
  83. cout << " " << endl;
  84. cout << "Jus turite: " << pestininkai << " pestininkus" << endl;
  85. cout << "Jus turite: " << sauliai << " saulius" << endl;
  86. cout << "Jus turite: " << sunkieji << " sunkiuosius" << endl;
  87. cout << "Jus turite: " << pagalbiniai << " pagalbininkus" << endl;
  88.  
  89. Sleep(200);
  90. }
  91.  
  92.  
  93.  
  94. _getch();
  95. return 0;
  96. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement