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<stdio.h>
using namespace std;

int main(){
    int a,n,x,i,sum=0;
    while(1){
		scanf("%d",&n);
		if(n==0)break;
		x=n/4;
		for(i=0;i<x;i++){
			cin>>a;
			sum +=a;
		}
        cout<<sum<<endl;
		sum=0;
    }
    return 0;
}

C++: #include<iostream>
#include<vector>
int main(){
	int a,b,c;
	c=0;
	b=1;
	std::vector<int> e(1);
	while(true){
		std::cin>>a;
		if(a>0){
			a=a/4;
			std::vector<int> v(a);
			for(int i=0;i<a;++i){
				std::cin>>v[i];
			}
			for(int i=0;i<a;++i){
				c=c+v[i];
			}
			e[b-1]=c;
			c=0;
			b=b+1;
			e.resize(b);
		}
		else{
			break;
		}
	}
	for(int i=0;i<b;++i){
		if(e[i]==0){
			break;
		}
		std::cout<<e[i]<<std::endl;
	}
}

C++: #include<cstdio>

using namespace std;

int main(){
	for(int n;scanf("%d",&n),n;){
		int cnt=0;
		for(int i=0,a;4*i<n;i++)	scanf("%d",&a),cnt+=a;
		printf("%d\n",cnt);
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

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

C++: #import<cstdio>
int main(){for(int n,a,i;a=0,scanf("%d",&n),n;printf("%d\n",a))for(i=n/4;i--;a+=n)scanf("%d",&n);}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>

#define LP(i,n) for(int i=0;i<n;i++)
#define Mset(x,v) memset(x,v,sizeof(x))
#define INF INT_MAX

using namespace std;
using LL=long long;

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

C++: #include <iostream>
using namespace std;
int main()
{
	int n, a, s, i;
	while (cin >> n && n)
	{
		for (i = s = 0; i < (int)((double)n/4.0+0.5); i++)
		{
			cin >> a;
			s += a;
		}
		cout << s << endl;
	}
}

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

#define rep(i, n) for(int i = 0; i < (n); i++)
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define all(v) (v).begin(), (v).end()
#define rev(s) (s).rbegin(), (s).rend()
#define MP make_pair
#define X first
#define Y second

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef pair<double, double> dP;

const int INF = 100000000;
const double EPS = 1e-10;

int d[100001];
int dsum[100001];

int main(){
	//freopen("test.txt", "r", stdin);
	while(1){
		int n;
		cin >> n;
		if(!n) break;
		int cnt = 0;
		rep(i, n/4){
			int m;
			cin >> m;
			cnt += m;
		}
		cout << cnt << endl;
	}

	return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
 int n;
 for(;cin>>n,n;)
{
  int sum=0;
for(;;n=n/5)
{
int tmp;
cin>>tmp;
sum+=tmp;
}
cout<<sum<<endl;
}

}

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

int main(){
  unsigned int n,sum;
  vector<int> ans;

  while(cin >> n, n){
    vector<int> vec;
        for(int i=0; i<n/4; i++){
      int temp;
      //cout << "niko" << endl;
      cin >> temp;
      vec.push_back(temp);
    }
	//for(int i:vec){
	//cout << "vec =";
	//cout << i << " ";
	//cout << endl;
	//}
    sum = 0;
    for(int j:vec){
      sum = sum + j;
    }
    ans.push_back(sum);
  }
  for(int i:ans){
    cout << i << endl;
  }
  return 0;
}

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

int main() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	for(int n; cin >> n && n;) {
		int sum = 0;
		for(int i = 0; i < n / 4; ++i) {
			int hit;
			cin >> hit;
			sum += hit;
		}
		cout << sum << endl;
	}

	return EXIT_SUCCESS;
}

C++: #include<iostream>
using namespace std;
int main(){
  int a,b,n,x=0;
  while(1){
    cin>>n;
    if(n==0)break;
    a=n/4;
    for(int i=0;i<a;i++){
      cin>>b;
      x+=b;
    }
  cout<<x<<endl;
  x=0;
  }
  return 0;
}

C++: #include <cstdio>

int main()
{

    
   
    for(;;)
    {
        int n=0;; int sum=0;

    
    scanf("%d",&n);
    if(n==0)
    {
        break;
    }
     int hit[n/4];

    for(int i=0; i<n/4; i++)
    {
        scanf("%d",&hit[i]);
        sum +=hit[i];
    }
    printf("%d\n",sum);

    }
}

C++: #include <iostream>

using namespace std;

int main(){
  while(1){
  int n,score=0,sum=0;

  cin >> n;
  if(n==0)break;

  for(int i=0;i<(n/4);i++){
    cin>>score;
    sum+=score;
}
  cout << sum<<endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int solve(int n) {
  int shoot = n / 4;

  int sum = 0;
  for (auto i = 0; i < shoot; ++i) {
    int num;
    cin >> num;
    sum += num;
  }

  return sum;
}

int main() {
  int n;
  
  while(cin >> n, n)
    cout << solve(n) << endl;
  
  return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<climits>
#include<vector>
#include<queue>
#include<stack>
#include<cmath>
#include<string.h>

using namespace std;

const int mod = 1000000007;

int main(){
    int n;
    while(cin>>n,n){
        int a,b;
        n/=4;
        while(n--){
            cin>>a;
            b+=a;
        }
        cout<<b<<endl;
        
    }
}

C++: #include<iostream>
using namespace std;
int n, a, sum;
int main() {
	while (true) {
		sum = 0;
		cin >> n;
		if (!n) { break; }
		n /= 4;
		for (int i = 0; i < n; i++) {
			cin >> a;
			sum += a;
		}
		cout << sum << endl;
	}
	return 0;
}

C++: #include<stdio.h>
main(n,k,s){for(;scanf("%d",&n),s=0,n;){for(;n>0;n-=4)scanf("%d",&k),s+=k;printf("%d\n",s);}}