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<vector>
#include <algorithm>

using namespace std;

int main()
{
  int n,b,sum;
  vector<int> a;

  while(cin>>n,n){

    sum = 0;
    a = {0};

    for(int i = 0;i < n/4;++i){
      cin>>b;
      a.push_back(b);
    }

    for(int e : a){
      sum += e;
    }

    cout<<sum<<endl;
  }

  return 0;
}

C++: #include <stdio.h>

int main(void) {
  int n, i;
  while( 1 ) {
    int ans = 0, a;
    scanf("%d", &n);
    if(!n) break;
    n /= 4;
    for(i = 0; i < n; ++i) {
      scanf("%d", &a);
      ans += a;
    }
    printf("%d\n", ans);
  }
  return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  for(;;){
    int n,k,s=0;
    cin>>n;
    if(!n)break;
    for(int i=0;i<n/4;i++)
      cin>>k,s+=k;

    cout<<s<<endl;
  }
}

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

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

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

using namespace std;

//typedef
//------------------------------------------
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vbb;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;

//container util
//------------------------------------------
#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#define iter(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)

//repetition
//------------------------------------------
#define loop(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  loop(i,0,n)

//constant
//--------------------------------------------
const double eps = 1e-10;
const double pi  = acos(-1.0);
const double inf = (int)1e8;

// output vector
// ------------------------------------------
namespace std {
    template<typename T> ostream & operator<<(ostream& os, vector<T> const& v){
        for(auto it=v.begin(); it!=v.end(); ++it){
            os << *it << (it+1==v.end() ? "" : ",");
        }
        return os;
    }
}

//clear memory
#define clr(a) memset((a), 0 ,sizeof(a))

int lcm(int a,int b){
   return a*b/__gcd(a,b);
}
 
vb pn((int)1e4+10); 
void prime_number(int n){
   fill(all(pn),true);
   pn[0]=false;pn[1]=false;
   loop(i,2,n/2+1){
      if(!pn[i]) continue;
      for(int j=2;i*j<=n;j++){
         pn[i*j]=false;
      }
   }
}

int main(){
   int n,c,ans;
   while(cin>>n){
      if(n==0)break;
      ans=0;
      rep(i,n/4){
         cin>> c;
         ans+=c;
      }
      cout << ans << endl;
   }
}

C++: #include<iostream>

using namespace std;

int main(){
    int shot;
    int total;
    int eachshot;
    int loop;
    while(1){
        cin>>shot;
        if(shot==0) break;
        loop = shot/4;
        total = 0;
        for(int i=0;i<loop;i++){
            cin>>eachshot;
            total+=eachshot;
        }
        cout<<total<<endl;
    }
  return 0;
}

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

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

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

int main() {
	int total_shot;
	while(cin>>total_shot,total_shot){
		int total_hit,n;
		int max = total_shot/4;
		for(int i = 0; i < max ; i++){
			cin >> n;
			total_hit += n;
		}
		cout << total_hit << endl;
		total_hit = 0;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>

using namespace std;

bool t[2000000];

int main(){
	
	int n, m, sum;
	
	while(true){
		cin >> n;
		if(n == 0){
			break;
		}
		sum = 0;
		for(int i = 0; i < n / 4; i++){
			cin >> m;
			sum += m;
		}
		printf("%d\n", sum);
	}
	
	return 0;
}

C++: #include<iostream>

using namespace std;

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

C++: #include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i,a,b) for(int i = (a); i < (b); i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int main(){
	int n;
	while(cin>>n,n){
		int sum = 0;
		rep(i,n/4){
			int x;
			cin>>x;
			sum +=x;
		}
		cout <<sum<<endl;
	}
	return 0;
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <complex>
#include <math.h>
#include <ctype.h>
using namespace std;
int n,p,ans=0;
int main(){
	while(cin>>n){
		if(n==0){break;}
		for(int i=0;i<n/4;i++){
		cin>>p;ans+=p;}
	cout<<ans<<endl;
	ans=0;}
    return 0;}

C++: #include<stdio.h>

int main(){

int n;
int x,s=0;

while(1){
scanf("%d",&n);
if(n==0)break;
for(int i=0;i<n/4;i++)
{scanf("%d",&x);
s+=x;}

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