第三周

  import java.util.Scanner;

  public class testscanner {
   /**
    * @parm args 
    */
   public static void main(String[] args)  {
   int nextValue;
   int sum = 0;
   Scanner sr = new Scanner(System.in);
   sr.useDelimiter("\\s");
   while(sr.hasNext()){
   nextValue = sr.nextInt();
   sum += nextValue;
   }
   System.out.println("Sum: "+ sum);
   sr.close();
    }
posted @ 2016-03-28 20:46  涛。  阅读(101)  评论(0编辑  收藏  举报