Learning to write algorytms using C++