UVA excercises solved in C++