标签:[] image ber int() 技术分享 logs exti src util
java.util.Scanner;
public class Demo_1{
public static void main(String[] agrs) {
Scanner input = new Scanner(System.in);
System.out.print("Enter a number 0 and 1000: ");
int number = input.nextInt();
int numbera = number % 10;
int numberb = number / 10;
int numberc= numberb % 10;
int numberd= numberc % 10;
int sum = numbera + numberc + numberd;
System.out.println("The sum of the digits is " + sum );
}
}
标签:[] image ber int() 技术分享 logs exti src util
原文地址:http://www.cnblogs.com/jingjing1314/p/7542457.html