第三次作业

import java.util.Scanner;
public class Text {

    public static void main(String[] args) {

        int nextValue;
        int sum = 0;
        Scanner kbIntput = new Scanner(System.in);
        kbIntput.useDelimiter("\\s");
        while(kbIntput.hasNextInt())
        {
            nextValue = kbIntput.nextInt();
            sum+=nextValue;
        }
        kbIntput.close();
        System.out.println("Sum:"+sum);
        System.out.printf("Sum:%d",sum);
    }

}

posted @ 2016-03-28 19:48  软二王伟伟  阅读(82)  评论(0编辑  收藏  举报