编程练习，c++和python