This paper is concerned with the limit cycle problem of a cubic reversible Hamiltonian system under perturbation of polynomials of degree n with a switching line x=0. The upper and lower bounds of the number of limit cycles are obtained using the first order Melnikov function and its expansion. The method for calculating the Melnikov function relies upon some iterative formulas, which differs from other approaches.