import java.util.Scanner;
public class lx3 {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.println("请输入4位会员卡号:");
int hy=sc.nextInt();
int z=0;
int g=hy%10;
int s=hy/10%10;
int b=hy/10/10%10;
int q=hy/10/10/10%10;
z=g+s+b+q;
System.out.println("会员卡号各位之和:"+" "+z);
}
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)