View Code of Problem 112

import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while(true){
			int count = scanner.nextInt();
			if(count ==0) {
				break;
			}
			int sum=0;
			for(int i=0;i<count;i++) {
				sum += scanner.nextInt();
			}
			System.out.println(sum);
		}
		scanner.close();
	}
}

Double click to view unformatted code.


Back to problem 112