[java]代码库
import java.util.*;
public class Agust {
public static void main(String[] args) {
Scanner input=new Scanner (System.in);
System.out.println("请输入后四位卡号:");
int nub1=input.nextInt();
System.out.println("会员卡号后四位是"+nub1);
int geWei=nub1%10;
int shiWei=nub1/10%10;
int baiWei=nub1/100%10;
int qianWei=nub1/1000;
System.out.println("会员卡各位"+geWei);
System.out.println("会员卡十位"+shiWei);
System.out.println("会员卡百位"+baiWei);
System.out.println("会员卡千位"+qianWei);
int sum=(geWei+shiWei+baiWei+qianWei);
System.out.println("会员卡位数和:"+sum);
if(sum<20)
System.out.println("恭喜您,您亲妈爆炸。");
else if(sum>=20)
System.out.println("恭喜您,您亲妈上天");
}
}