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>
using namespace std;
int main(){
    int n; //合計射数
    int h; //的中回数
    
    while(true){
        cin >> n;
        if(n == 0) break;

        int c = 0; //合計的中数
        for(int i = 1; i <= n / 4; i++){
            cin >> h;
            c += h;
        }
        cout << c << endl;
    }
}

C++: #include <iostream>

int main() {
	int n;
	
	while (std::cin >> n, n) {
		int ans = 0;

		for (int i = 0; i < n / 4; ++i) {
			int x;
			std::cin >> x;

			ans += x;
		}

		std::cout << ans << std::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){
      int n; cin >>n;
      ans += n;
    }
    cout <<ans <<endl;
  }
  return 0;
}

C++: #include<iostream>

using namespace std;

int main(void){
  int n,x;

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

C++: #include<iostream>
using namespace std;int l,h,a;int main(){for(;1;cin>>l){if(l<1){break;}h=0;for(;l>0;l=l-4){cin>>a;h+=a;}cout<<h<<endl;}}

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

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

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

C++: #define _USE_MATH_DEFINES
#define INF 100000000
#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>

using namespace std;

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

static const double EPS = 1e-8;

int main(){
	int n;
	while(~scanf("%d",&n)){
		if(n==0) break;
		int sum=0;
		for(int i=0;i<n/4;i++){
			int p;
			scanf("%d",&p);
			sum += p;
		}
		printf("%d\n",sum);
	}
}

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

#define debug(x) cout <<"DEBUG"<<" "<<#x<<":"<<x<<'\n'

//↓0-indexか1-indexでn回繰り返し
#define rep(i,n) for(int i = 0; i < ((int)(n)); i++)   //0-index昇順
#define rep1(i,n) for(int i = 1; i <= ((int)(n)); i++) //1-index昇順
#define rrep(i,n) for(int i = ((int)(n)-1); i >= 0; i--)  //0-index降順
#define rrep1(i,n) for(int i = ((int)(n)); i >= 1; i--)   //1-index降順
//rep2 -> 第二引数 m から n 回繰り返し ex) m=5 n=3 なら i=5,i=6,i=7 まで
#define rep2(i,m,n) for(int i = ((int)(m)); i < ((int)(n))+((int)(m)); i++)
#define SIZE(x) ((int)((x).size()))
#define all(x) (x).begin(),(x).end()
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vii; //2次元配列
typedef vector<ll> vll;
typedef vector<string> vs;
template<class T,class U> inline bool chmax(T &a, const U &b){if(a<b){a=b;return 1;}return 0;}
template<class T,class U> inline bool chmin(T &a, const U &b){if(a>b){a=b;return 1;}return 0;}

/* 円周率は M_PI を使おうね */
const ll infll = (1LL<<62)-1;
const int inf = (1<<30)-1;

/*FUNCs=================================================*/


/*MAIN==================================================*/
signed main(){
    //cin.tie(nullptr);
    //ios::sync_with_stdio(false);   //cin cout 高速化
    //cout << fixed << setprecision(15);

    int n;
    while(cin >> n) {
        if(!n) break;
        int cnt = 0;
        rep(i,n/4) {
            int p; cin >> p;
            cnt += p;
        }
        cout << cnt << '\n';
    }
}

C++: #include<iostream>
using namespace std;
int main() {
	int a4;
	int b[1001];
	int x;
	for (int j = 0;; j++){
		cin >> a4;
		if (a4 == 0){
			x = j;
			break;
		}
		for (int i = 0; i < a4/4; i++)
		{
			int y;
			cin >> y;
			b[j] += y;
		}
	}
	for (int i = 0; i < x; i++){
		cout << b[i] << endl;
	}
}

C++: #include <iostream>

int main() {
	int n;
	
	while (std::cin >> n, n) {
		int ans = 0;

		for (int i = 0; i < n / 4; ++i) {
			int x;
			std::cin >> x;

			ans += x;
		}

		std::cout << ans << std::endl;
	}
}

C++: #include <iostream>

using namespace std;

int main() {
	
	int n;
	
	while(cin >> n && n != 0) {
		
		int temp, sum = 0;
		
		for(int i=0;i<n/4;i++) {
			
			cin >> temp;
			sum += temp;
			
		}
		
		cout << sum << "\n";
		
		
	}
	
	return 0;
	
}

C++: #include <functional>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <sstream>
#include <bitset>
#include <vector>
#include <cstdio>
#include <ctime>
#include <queue>
#include <deque>
#include <cmath>
#include <stack>
#include <list>
#include <map>
#include <set>

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
#define sz size()

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


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

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

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

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

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

C++: #include <iostream>
using namespace std;
int main( void )
{
	int n;
	while ( cin >> n && n )
	{
		int sum = 0;
		for ( int i = 0; i < n/4; i++ )
		{
			int score;
			cin >> score;
			sum += score;
		}
		cout << sum << endl;
	}
	return 0;
}