A magnetic impurity doped in a superconductor produces a localized excited state within the energy gap. This problem is studied by applying Wilson's numerical renormalization group method. The ground state and the first excited state are traced by changing the exchange coupling constant relative to the energy gap. Thereby the position of the localized excited state within the energy gap is determined over the whole regime of the magnitude of TK/∂ (TK: Kondo Temperature, ∂: superconducting energy gap). A crossing of the lowest doublet and singlet is clearly observed at Tk/∂⋍0.3. The ferromagnetic and Ising cases have been studied also. In the ferromagnetic case the localized excited state stays close to the gap edge since the exchange coupling is renormalized to a weak coupling. The case of the Ising-like sd coupling, which is exactly solvable, can be used to check the reliability of the present approach and the effect of the discretization.