/*** * @Title: test_draw_a_lottery_or_raffle* @Description: 该方法的主要作用:输入四位数,各位数数字之和大于20 中奖,否则没中奖* @param 设定文件 * @return 返回类型:void * @throws*/@Testpublic 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("很抱歉,没中奖!");}}