import java.util.Scanner;//导入Scanner类
/*
* 使用Scanner类接收用户输入
* 模拟幸运抽奖
*/
public class Lucky {
public static void main(String[] args) {
//声明变量
int custNo;//会员卡号
System.out.println("请输入4位会员卡号:");
//扫描器
Scanner input=new Scanner(System.in);
//接收输入数据
custNo=input.nextInt();
int onePlace=custNo%10;//个位
int tenPlace=custNo/10%10;//十位
int hunPlace=custNo/100%10;//百位
int thouPlace=custNo/1000;//千位
int sum;//会员各个位数之和
sum=(onePlace+tenPlace+hunPlace+thouPlace);
System.out.println("会员卡号"+custNo+"各位之和:"+(sum));
String result=sum>20? "是幸运客户吗?true" : "是幸运客户吗?false";
System.out.print(result);
}
}