L. Shapiro has presented and solved a problem of a class of random walks with absorbing points on plane lattice points .[1]He divided the all lattice points on line y=x(x>0) into two classes by modulo 2, and selected one of the two classes to be the set of absorbing points. In this paper,we generalize the Shapiro problem:divide the all lattice points on line y = x(x>0) into k classes by modulo k,and select one class or more classes of the k classes to be the set of absorbing points. We solve the generalized problem by using the residue method and give an application of it to probability theory.