Dynamic programming algorithm is classical strategy to solve the optimization problem. The distributing of enterprise resource is a multistage decision problem, having the characteristic of dynamic programming algorithm. We establish distribution of mathematical model of planning target, using dynamic programming principle and method to divide enterprise resource allocation stage reasonably, and then we use the recursion method to structure dynamic programming equation from the bottom up. Using VC++6.0 development platform is to compute the optimal decision-making sequence and maximum of profit. Dynamic programming makes optimum resource allocation for an enterprise, and it is high application value in resource allocation.