#include <iostream>
void shop( )
{
std:: cout << "I'm in shop now\n " ;
}
void again( )
{
std:: cout << "Again() is running...\n " ;
shop( ) ;
std:: cout << "Returned to again() after shopping\n " ;
//again(); commented to make program terminate normally
}
void game( )
{
std:: cout << "game() is running...\n " ;
shop( ) ;
std:: cout << "Returned to game() after shopping\n " ;
again( ) ;
}
int main( )
{
std:: cout << "program started\n " ;
game( ) ;
std:: cout << "exiting...\n " ;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdm9pZCBzaG9wKCkKewogICAgIHN0ZDo6Y291dCA8PCAiSSdtIGluIHNob3Agbm93XG4iOwp9Cgp2b2lkIGFnYWluKCkKewogICAgc3RkOjpjb3V0IDw8ICJBZ2FpbigpIGlzIHJ1bm5pbmcuLi5cbiI7CiAgICBzaG9wKCk7CiAgICBzdGQ6OmNvdXQgPDwgIlJldHVybmVkIHRvIGFnYWluKCkgYWZ0ZXIgc2hvcHBpbmdcbiI7CiAgICAvL2FnYWluKCk7IGNvbW1lbnRlZCB0byBtYWtlIHByb2dyYW0gdGVybWluYXRlIG5vcm1hbGx5IAp9Cgp2b2lkIGdhbWUoKQp7CiAgICBzdGQ6OmNvdXQgPDwgImdhbWUoKSBpcyBydW5uaW5nLi4uXG4iOwogICAgc2hvcCgpOwogICAgc3RkOjpjb3V0IDw8ICJSZXR1cm5lZCB0byBnYW1lKCkgYWZ0ZXIgc2hvcHBpbmdcbiI7CiAgICBhZ2FpbigpOwp9CgppbnQgbWFpbigpCnsKICAgIHN0ZDo6Y291dCA8PCAicHJvZ3JhbSBzdGFydGVkXG4iOwogICAgZ2FtZSgpOwogICAgc3RkOjpjb3V0IDw8ICJleGl0aW5nLi4uXG4iOwp9