A three-point fifth-order accurate generalized compact scheme (GC scheme) w
ith a spectral-like resolution is constructed in a general way. The scheme
satisfies the principle of stability and the principle about suppression of
the oscillations, therefore numerical errors can decay automatically and n
o spurious oscillations are generated around shocks. The third-order TVD ty
pe Runge-Kutta method is employed for the time integration, thus making the
GC scheme best suited for unsteady problems. Numerical results show that t
he GC scheme is shock-capturing. The time-dependent boundary conditions pro
posed by Thompson are well employed when the algorithm is applied to the Eu
ler equations of gas dynamics.