package com.bwj;
import java.util.Scanner;
public class Num {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner Num = new Scanner(System.in);
int a = Num.nextInt();
int b = a % 10;
int c = a / 10 % 10;
int d = a / 100 % 10;
int f = a / 1000 % 10;
int g = b + c + d + f;
System.out.println("输出结果为:个位:" + b + ",十位:" + c + ",百位:" + d + ",千位:" + f + ",和为:" + g);
}
}
输出结果为: