#include<iostream>
using namespace std;
/* such a function will not be safe if x is non static variable of it */
int &fun()
{
static int x;
return x;
}
int main()
{
fun() = 10;
/* this line prints 10 on screen */
printf(" %d ", fun());
getchar();
return 0;
}
I2luY2x1ZGU8aW9zdHJlYW0+IAp1c2luZyBuYW1lc3BhY2Ugc3RkOwovKiBzdWNoIGEgZnVuY3Rpb24gd2lsbCBub3QgYmUgc2FmZSBpZiB4IGlzIG5vbiBzdGF0aWMgdmFyaWFibGUgb2YgaXQgKi8KaW50ICZmdW4oKQp7CiAgICBzdGF0aWMgaW50IHg7IAogICAgcmV0dXJuIHg7Cn0gICAgCgppbnQgbWFpbigpCnsKICAgIGZ1bigpID0gMTA7CiAgICAvKiB0aGlzIGxpbmUgcHJpbnRzIDEwIG9uIHNjcmVlbiAqLwogICAgcHJpbnRmKCIgJWQgIiwgZnVuKCkpOwogICAgZ2V0Y2hhcigpOwogICAgcmV0dXJuIDA7Cn0=