The code is 90% C++ to begin with. Rip off the static void main and the damn thing will very nearly compile as C++.
Well it ought to be close enough for you to at least have an attempt yourself.
Being able to crib from something else which is "close enough" to what you want is a vital skill. Even if you don't know any C# at all (I don't), it's possible to have a pretty damn good idea about what it is doing.