第三周JAVA学习
import java.util.Scanner;
public class testscanner {
public static void main(String[] args) {
int nextValue;
int sum = 0;
Scanner sr = new Scanner(System.in);
sr.useDelimiter("\s");
while(sr.hasNextInt()){
nextValue = sr.nextInt();
sum += nextValue;
}
System.out.println("Sum: "+ sum);
sr.close();
}
}