import java.util.Scanner;
public class A03 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input = new Scanner (System.in);
System.out.println("请输入4位会员卡号:");
int num=input.nextInt();
int A=num%10;
int Tem=num/10%10;
int Hundreds=num/100%10;
int Kbit=num/1000;
int sum=A+Tem+Hundreds+Kbit;
System.out.println("会员卡号"+num+"各位之和:"+sum);
}
}
转载于:https://blog.51cto.com/765133133/1420130