首页 > 其他 > 详细

第三次作业

时间:2016-03-28 21:37:37      阅读:250      评论:0      收藏:0      [点我收藏+]

import java.util.Scanner;

public class Practice {

public static void main(String[] args) {
    int nextValue;
    int sum = 0;
    Scanner kbInput = new Scanner(System.in);
    kbInput.useDelimiter("\\s");

    while (kbInput.hasNextInt()) {
        nextValue = kbInput.nextInt();
        sum += nextValue;
    }
    System.out.println("Sum:" + sum);

}

}
技术分享

第三次作业

原文:http://www.cnblogs.com/wsxzr/p/5330343.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!