The 3n+1 Problem from UVa Online Judge implemented in C++