A new method named as Statistical Average Algorithm is developed for solving the structural dynamic compound inverse problem, which means to identify structural parameters with unknown input or to inverse input time history with unknown structural parameters. By taking the mechanical characteristic of the ground motion as an additional condition, an iterative algorithm based on the least-squares technique is developed so that the input process and structural parameters can be correctly determined using only output measurements. The procedure of the proposed method is discussed in detail, and a mathematical proof is presented as well in the appendix. A practical input situation such as earthquake, ambient vibration is considered in the numerical examples to verify the accuracy, reliability and robustness of the proposed algorithm. Considering the background of the practical application, both of the noise-free and noise-included output responses are considered in the numerical examples. In all cases, the proposed method identifies the structural parameters and reconstructs the input process rationally.