Finalized matrix rotation program in C++