#include <iostream>
int main()
{
int pin = 0;
float money = 300.0f;
float deposit = 0.0f;
float withdrawal = 0.0f;
std::cout<<"Write pin: "<<std::endl;
if(std::cin >> pin && pin == 8765)
{
int option = 0;
do
{
std::cout<<"1. Deposit"<<"\n";
std::cout<<"2. Withdrawal"<<"\n";
std::cout<<"3. Balance"<<"\n";
std::cout<<"4. Quit"<<std::endl;
std::cin >> option;
switch(option)
{
case 1:
std::cout<<"Input ammount: "<<std::endl;
std::cin>>deposit;
money += deposit;
break;
case 2:
std::cout<<"Quantity to withdrawal: "<<std::endl;
std::cin>>withdrawal;
money -= withdrawal;
break;
case 3:
std::cout<<"Balance: "<<money<<std::endl;
break;
default:
break;
}
}
while(std::cin.clear(), option != 4);
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKaW50IG1haW4oKQp7CglpbnQgcGluID0gMDsKCWZsb2F0IG1vbmV5ID0gMzAwLjBmOwoJZmxvYXQgZGVwb3NpdCA9IDAuMGY7CglmbG9hdCB3aXRoZHJhd2FsID0gMC4wZjsKCXN0ZDo6Y291dDw8IldyaXRlIHBpbjogIjw8c3RkOjplbmRsOwoJaWYoc3RkOjpjaW4gPj4gcGluICYmIHBpbiA9PSA4NzY1KQoJewoJCWludCBvcHRpb24gPSAwOwoJCWRvCgkJewoJCQlzdGQ6OmNvdXQ8PCIxLiBEZXBvc2l0Ijw8IlxuIjsKCQkJc3RkOjpjb3V0PDwiMi4gV2l0aGRyYXdhbCI8PCJcbiI7CgkJCXN0ZDo6Y291dDw8IjMuIEJhbGFuY2UiPDwiXG4iOwoJCQlzdGQ6OmNvdXQ8PCI0LiBRdWl0Ijw8c3RkOjplbmRsOwoJCQlzdGQ6OmNpbiA+PiBvcHRpb247CgkJCXN3aXRjaChvcHRpb24pCgkJCXsKCQkJCWNhc2UgMToKCQkJCXN0ZDo6Y291dDw8IklucHV0IGFtbW91bnQ6ICI8PHN0ZDo6ZW5kbDsKCQkJCXN0ZDo6Y2luPj5kZXBvc2l0O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