We propose a polynomial-time algorithm for simulation of the class of pairing Hamiltonians, e.g., the BCS Hamiltonian, on an NMR quantum computer. The algorithm adiabatically finds the low-lying spectrum in the vicinity of the gap between the ground and the first excited states and provides a test of the applicability of the BCS Hamiltonian to mesoscopic superconducting systems, such as ultrasmall metallic grains.