baru003のブログ

baruの雑記兼備忘録

AOJ 1041

・問題リンク Kyudo: A Japanese Art of Archery

・コメント
そのまま実装して終わりですね。5分もいらないですよね(笑)

・ソース

import java.util.Scanner;

public class P1041 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int n = sc.nextInt();
			if (n == 0)
				break;
			int ans = 0;
			for (int i = 0; i < n / 4; i++) {
				ans += sc.nextInt();
			}
			System.out.println(ans);
		}
	}

}