Convert lorenz.c to C++