Okay, okay, I *know* it's C++, but I'll still refrain from bad coding practice.
Added a version.