ACM steps 1.1.4

来源:互联网 发布:直播那个软件最好 编辑:程序博客网 时间:2024/06/05 19:58

http://acm.hdu.edu.cn/game/entry/problem/show.php?chapterid=1&sectionid=1&problemid=3004

import java.util.Scanner;public class Main {public static void main(String[] args) {int n;Scanner in = new Scanner(System.in);while (in.hasNextInt()) {int s = 0;n = in.nextInt();if (n == 0) {break;}while (n-- > 0) {s += in.nextInt();}System.out.println(s);}}}


0 0
原创粉丝点击