This article presents a algorithm for solving Three-dimensional assignment problem. Firstly, decompose the three-dimensional cubic matrix corresponding to the three-dimensional assignment problem into multiple two-dimensional planar matrices, and obtain that the assignment problems corresponding to these two-dimensional planar matrices have the same feasible solution as the original three-dimensional assignment problem. Then, the leading principal submatrix algorithm is used to solve each two-dimensional assignment problem. The characteristic of the leading principal submatrix algorithm is that each operation only needs to consider the local (leading principal submatrix) of the assignment matrix of the two-dimensional assignment matrix, without considering the entire assignment matrix. Starting from the first-order leading principal submatrix of the assignment matrix, Through the same solution transformation, the row minimum element of the leading principal submatrix of each order of the assignment matrix is found step by step, and the optimal solution of the two-dimensional assignment problems are obtained. Finally, by comparing the optimal solutions of these two-dimensional assignment problems, the optimal solutions of the original three-dimensional assignment problems are obtained. This algorithm can find the optimal solution for three-dimensional assignment problems in a patterned manner, facilitating computer programming and handling assignment problems with a large number of people and tasks.