/**
*
* @Title: test_draw_a_lottery_or_raffle
* @Description: 该方法的主要作用:输入四位数,各位数数字之和大于20 中奖,否则没中奖
* @param 设定文件
* @return 返回类型:void
* @throws
*/
@Test
public void test_draw_a_lottery_or_raffle(){
int curno = 0; //会员卡号
//输入会员卡号
System.out.println("请输入会员卡号,4位数:");
Scanner in = new Scanner(System.in);
curno = in.nextInt();
int ge = curno%10; //个位数
int shi = curno/10%10; //十位数
int bai = curno/100%10; //百位数
int qian = curno/1000; //千位数
curno = ge+shi+bai+qian;
if(curno>20){
//中奖了
System.out.println("恭喜你,中奖了!");
}else{
//没中奖
System.out.println("很抱歉,没中奖!");
}
}