Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func configure(scanner *bufio.Scanner) {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1000005), 1000005)
}
func getNextString(scanner *bufio.Scanner) string {
	scanned := scanner.Scan()
	if !scanned {
		panic("scan failed")
	}
	return scanner.Text()
}
func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}
func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}
func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}
func main() {
	fp := os.Stdin
	wfp := os.Stdout
	extra := 0
	if os.Getenv("I") == "IronMan" {
		fp, _ = os.Open(os.Getenv("END_GAME"))
		extra = 100
	}
	scanner := bufio.NewScanner(fp)
	configure(scanner)
	writer := bufio.NewWriter(wfp)
	defer func() {
		r := recover()
		if r != nil {
			fmt.Fprintln(writer, r)
		}
		writer.Flush()
	}()
	solve(scanner, writer)
	for i := 0; i < extra; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
}
func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	for n := getNextInt(scanner); n > 0; n = getNextInt(scanner) {
		sum := 0
		for j := 0; j < n/4; j++ {
			sum += getNextInt(scanner)
		}
		fmt.Fprintln(writer, sum)
	}
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <cstring>
#include <cmath>

using namespace std;

int main(int argc, char *argv[]) {
  int arrow;
  while (true) {
    cin >> arrow;
    if (arrow == 0)
      break;
    arrow /= 4;
    int res = 0;
    for (int i = 0; i < arrow; i++) {
      int p;
      cin >> p;
      res += p;
    }
    cout << res << endl;
  }
  return 0;
}

C++: #include<stdio.h>

int main(){

int n;
int x,s=0;

while(1){
scanf("%d",&n);

for(int i=0;i<n/4;i++)
{scanf("%d",&x);
sum+=x;}

printf("%d\n",s);
s=0;
}
return 0;
}

C++: # include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
const double PI = acos(-1);
template<class T>constexpr T INF() { return ::std::numeric_limits<T>::max(); }
template<class T>constexpr T HINF() { return INF<T>() / 2; }
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
template<typename T>vector<T> make_v(size_t a){ return vector<T>(a); }
template<typename T,typename... Ts>auto make_v(size_t a, Ts... ts){ return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...)); }
template<typename T,typename V>typename enable_if<is_class<T>::value==0>::type fill_v(T &t, const V &v){ t = v; }
template<typename T,typename V>typename enable_if<is_class<T>::value!=0>::type fill_v(T &t, const V &v){ for(auto &e : t) fill_v(e, v); }
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++)if ((n >> i) & 1)cnt++; return cnt; }
int d_sum(LL n) { int ret = 0; while (n > 0) { ret += n % 10; n /= 10; }return ret; }
int d_cnt(LL n) { int ret = 0; while (n > 0) { ret++; n /= 10; }return ret; }
LL gcd(LL a, LL b) { if (b == 0)return a; return gcd(b, a%b); };
LL lcm(LL a, LL b) { LL g = gcd(a, b); return a / g*b; };
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define REP(i,upupu)         FOR(i,0,upupu)
# define INIT                 std::ios::sync_with_stdio(false);std::cin.tie(0)

int n;

int main(){
    while(cin >> n && n){
        n /= 4;
        int sum = 0;
        int a;
        REP(i, n){
            cin >> a;
            sum += a;
        }
        cout << sum << endl;
    }
}

C++: #include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
typedef complex<double> P;

int main() {
  int N;
  while(cin >>N && N){
    int ans = 0;
    REP(i, N/ 4){
      int n; cin >>n;
      ans += n;
    }
    cout <<ans <<endl;
  }
  return 0;
}

C++: #include<vector>
#include<list>
#include<algorithm>
#include<iostream>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
  int i;
  int m,n,o;
  while(cin>>n&&n){
    o=0;
    for(i=0;i<n/4;i++){
      cin>>m;
      o+=m;
    }
    cout<<o<<endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

int main()
{
    int N;
    while (cin >> N, N) {
        int a, sum = 0;
        for (int i = 0; i < N/4; i++) {
            cin >> a;
            sum += a;
        }
        cout << sum << endl;
    }
    return 0;
}

C++: #include <iostream>
using namespace std;

int main(){
	int n,t,result=0;
	while(1){
		cin >> n;
		if(n==0) break;
		for(int i=0;i<n/4;i++){
			cin >> t;
			result+=t;
		}
		cout << result << endl;
		result=0;
	}
}

C++: #include<iostream>
using namespace std;

int main(){
    while(1){
        int n;
        cin >> n;
        if(n == 0)break;
        int sum = 0, num;
        for(int i = 0; i < n / 4; i++){
            cin >> num;
            sum += num;
        }
        cout << sum << endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>

int main(void) {
    using namespace std;

    while (true) {
        int n;
        cin >> n;
        if (n == 0) {
            break;
        }

        int sum = 0;
        int score;
        for (int i = 0 ; i < n / 4 ; i++) {
            cin >> score;
            sum += score;
        }
        printf("%d\n", sum);
    }
    return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
  int n;
  while(cin>>n,n){
    int s=0,a;
    while(n--){
      cin>>a;
      s+=a;
    }
    cout<<s<<endl;
  }
}

C++: #include <iostream>

using namespace std;

int main ()
{
	for (int u = 0; u < 100; u++)
	{
		int n,a[100];
		cin >> n;
		if (n == 0)
		{
			break;
		}

		for (int i = 0; i < n / 4; i++)
		{
			cin >> a[i];
		}

		int co = 0;

		for (int i = 0; i < n / 4; i++)
		{
			co += a[i];
		}
		cout << co << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<vector>
int main() {
	std::vector<int>v;
	std::vector<int>y;
	while (1) {
		int n;
		std::cin >> n;
		int a = 0;
		for (int i = 0; i < n / 4; ++i) {
			if (v[i] == 0) {
				break;
			}
			std::cin >> v[i];
			v.push_back(v[i]);
			a += v[i];
		}
		y.push_back(a);
	}
	for (int i = 0; i < y.size(); ++i) {
		std::cout << y[i]<< std::endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
 
int main()
{
int n,m,s;
while(cin>>n,n){
s=0;
n/=4;
while(n-->0){cin>>m;s+=m;}
cout<<s<<endl;
}
}