int a=111; int b=a%10; //baiwei int d=a/10%10; //gewei int c=a/100; //shiwei int sum=0; sum=b+c+d; System.out.println(sum);