In this paper, we consider the numerical optimal investment strategy of defined-contribution pension plan with return of premiums. A numerical method called Markov chain approximation is proposed to solve the optimal control problem. Firstly, a Markov chain with one-step transition probability is constructed to approximate the dynamic wealth process. Then, based on one-step transition probability, the iterative formulas of value function and optimal control are established. Next, on account of the iterative formulas, a numerical optimal algorithm is proposed to obtain the optimal solution. Finally, a numerical simulation is given and it shows that the numerical optimal control method is more applicable.