View Code of Problem 112

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		for (;;) {
			int N = in.nextInt();
			int b = 0;
			for (int i = 0; i < N; i++) {
				int a = in.nextInt();
				b = a + b;

			}
			if (N != 0) {
				System.out.println(b);
			}

		}
	}
}

Double click to view unformatted code.


Back to problem 112