Boy * i = new Boy("wuxia2001");
// It's me.
Girl * u ;
while (true) {
try {
u = new Girl();
}
catch (std::bad_alloc) {
continue;
}
if (u != NULL){ break; }
// Usually you will be trapped in this loop
// for a *very* long time.
}
try{
while (true) {
switch( u->statu() ){
case"hungry": i->feed(u);break;
case"tired": i->hug(u);break;
case"sleepy": i->sleep(u);break;
default: i->say(u,"I Love U");break;
}
}
}
catch(Girl::DoNotLoveMe){
// Some day I will catch this message.
i->believeInLove (false);
// I will never believe in love anymore.
sys.exit(-1);
// Until reboot.

}
_
  Girls, I have                             
waiting for you
      for
    2230 days 22 hrs
  06
mins 40 secs
Live alone forever and ever.
- wuxia2001
浙ICP备15000106号-4