Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- #include <conio.h>
- #include <Windows.h>
- int main()
- {
- int pestininkai = 0;
- int sunkieji = 0;
- int sauliai = 0;
- int pagalbiniai = 0;
- int pinigai = 0;
- while (true)
- {
- system ("cls");
- pinigai = pinigai + 10;
- cout << "Jus turite pinigu: " << pinigai << endl;
- cout << "***************************" << endl;
- if (GetAsyncKeyState( '1' ))
- {
- pinigai = pinigai - 10;
- if (pinigai<0)
- {
- cout << "Atleiskit taciau siuo metu Jus neturite tiek pinigu" << endl;
- pinigai = pinigai + 10;
- }
- else
- pestininkai++;
- }
- if (GetAsyncKeyState( '2' ))
- {
- pinigai = pinigai - 20;
- if (pinigai<0)
- {
- cout << "Atleiskit taciau siuo metu Jus neturite tiek pinigu" << endl;
- pinigai = pinigai + 20;
- }
- else
- sunkieji++;
- }
- if (GetAsyncKeyState( '3' ))
- {
- pinigai = pinigai - 30;
- if (pinigai<0)
- {
- cout << "Atleiskit taciau siuo metu Jus neturite tiek pinigu" << endl;
- pinigai = pinigai + 30;
- }
- else
- sauliai++;
- }
- if (GetAsyncKeyState( '4' ))
- {
- pinigai = pinigai - 40;
- if (pinigai<0)
- {
- cout << "Atleiskit taciau siuo metu Jus neturite tiek pinigu, kad galetumet nuspirkti Pagalbininka" << endl;
- pinigai = pinigai + 40;
- }
- else
- pagalbiniai++;
- }
- cout << "***************************" << endl;
- cout << " " << endl;
- cout << "Jus turite: " << pestininkai << " pestininkus" << endl;
- cout << "Jus turite: " << sauliai << " saulius" << endl;
- cout << "Jus turite: " << sunkieji << " sunkiuosius" << endl;
- cout << "Jus turite: " << pagalbiniai << " pagalbininkus" << endl;
- Sleep(200);
- }
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement