P60 2.6
import java.util.Scanner;
public class Num
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
System.out.println("请输入一个大于0小于1000的整数:");
int x=input.nextInt();
int a= x/100;
int b= (x/10)%10;
int c= x%10;
System.out.println("三数相加结果是:" + (a+b+c));
}
}