用了个随机函数
package test;
import java.util.*;
public class www {
public static void main(String[] args) {
int random=(int)(Math.random()*10);
Scanner input=new Scanner(System.in);
System.out.print("输入会员卡号:");
int number=input.nextInt();
int gewei=number%10;
if(gewei==random) {
System.out.println(number+"恭喜你中奖了!");
}else {
System.out.println(number+"谢谢您的参与");
}
System.out.println("产生的数为:"+random);
}
}