标签:and scanner int its git tin class sys int()
//P60 2.6
import java.util.Scanner;
public class Demo_1{
public static void main(String[] agrs) {
Scanner input = new Scanner(System.in);
System.out.("Enter a number 0 and 1000: ");
int number = input.nextInt();
int a = number%10;
int b = number/10;
int c = number/100;
int sum = a + b + c;
System.out.println("The sum of the digits is " + sum );
}
}标签:and scanner int its git tin class sys int()
原文地址:http://www.cnblogs.com/foreminent/p/7542477.html