Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func main() {
	scanner.Split(bufio.ScanWords)
	a := make([]int, 8)
	for i := 0; i < 8; i++ {
		a[i] = nextInt()
	}
	s := 0
	for i := 0; i < 4; i++ {
		s += a[i]
	}
	t := 0
	for i := 4; i < 8; i++ {
		t += a[i]
	}
	fmt.Println(max(s, t))
}

C++: #include<cstdio>
#include<iostream>
using namespace std;
int main()
{
	int i,j,n,s=0,t=0;
	for(i=1;i<=4;i++)
	{
		cin>>n;
		s+=n;
	}
	for(i=1;i<=4;i++)
	{
		cin>>n;
		t+=n;
	}
	if(s>=t)cout<<s;
	else cout<<t;
}vvvvvvvvvvvvvvv

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main () {
         int ans;
         int a,b;
         int S=0,T=0;
         for(int i=0;i<4;i++){
                 cin>>a;
                  S+=a;
          }
         for(int j=0;j<4;j++){
                   cin>>b;
                   T+=b;
          }
          ans=max(S,T);
           cout<<ans<<endl;
           return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <vector>
#include <queue>
#include <functional>
#include <cstdio>

using std::endl;

#define ll long long int
#define FOR(a, s, n) for(int a = s; a < n; ++a)
#define LEP(a, n) for(int a = 0; a < n; ++a)
#define INF 1145141919810
#define MOD 1000000007
#define OUT std::cout
#define IN std::cin
#define itn int
#define fro for
#define sdt std
#define asn ans

int A, B, buf;

int main()
{
	LEP(a, 4)
	{
		IN >> buf;
		A += buf;
	}
	LEP(a, 4)
	{
		IN >> buf;
		B += buf;
	}

	OUT << std::max(A, B) << endl;
	
	return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
    int A,B,C,D,E,F,G,H,S,T;
    cin >> A >> B >> C >> D >> E >> F >> G >> H;
    S=A+B+C+D;
    T=E+F+G+H;
    cout << (S>T?S:T) << endl;
    return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>

using namespace std;

#ifdef _MSC_VER
#define __typeof__ decltype

template <class T>
int __builtin_popcount(T n) { return n ? 1 + __builtin_popcount(n & (n - 1)) : 0; }
#endif

#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define popcount __builtin_popcount

const double EPS = 1e-10;
typedef long long ll;
typedef pair<int, int> pint;


int main()
{
	int a[4], b[4];
	for (int i = 0; i < 4; ++i)
		scanf("%d", a + i);
	for (int i = 0; i < 4; ++i)
		scanf("%d", b + i);
	int s = accumulate(a, a + 4, 0);
	int t = accumulate(b, b + 4, 0);
	printf("%d\n", max(s, t));
}

C++: 
//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0510

#include <algorithm>
#include <iostream>
#include <vector>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

using namespace std;

//テ」ツδ榲」ツつッテ」ツδュテ・ツョツ堙ァツセツゥ
#define ALL(v) (v).begin(),(v).end()
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
#define REP(i,a,b) for(int i=(int)(a); i<(int)(b); ++i)
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define SORT(x) sort(begin(x),end(x))
#define SELECT_SORT(x, n) sort(begin(x),begin(x)+n)
#define SWAP(type, a, b) do {type tmp = a; a = b; b = tmp;} while (0)
#define rep_split(tok,a_str,re) for(char *tok = strtok((char *)a_str.c_str(),re); tok != NULL; tok = strtok(NULL,re))

//テ・ツョツ堙ヲツ閉ー
#define INF 2000000000000
#define MAX 10

//DEBUGテァツ板ィ
#define BAR() cout << "----------------------------" << endl;
#define DUMP(v) (cerr << #v << ": " << v << endl)
#define PRINT(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;


int main()
{
	int a[]={0};
	int b[]={0};
	int S= 0;
	int T=0;
	
	cin >> a[0] >> a[1] >> a[2] >> a[3];
	cin >> b[0] >> b[1] >> b[2] >> b[3];
	
	rep(i,4){
		S += a[i];
		T += b[i];
	}
	
	if(S >= T){
		cout << S << endl;
	}else{
		cout << T << endl;
	}
	
}

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

int main(){
  int a[8];
  for(int i=0;i<8;i++) cin >> a[i];
  cout << max(a[0] + a[1] + a[2] + a[3],a[4] + a[5] + a[6] + a[7]) << endl;
}

C++: #include <iostream>

using namespace std;

main(){
  int a, b, c, d;
  while(cin >> a >> b >> c >> d){
    int sum1, sum2;
    sum1=a+b+c+d;
    cin >> a >> b >> c >> d;
    sum2=a+b+c+d;
    if(sum1>=sum2) cout << sum1 << endl;
    else cout << sum2 << endl;
  }
  return 0;
}

C++: /*
	AOJ 0510 JOI yo 2005 2006 1 Score
*/

//ミスを防ぐためにまずは基本のIncludeをすべて格納する

#include<fstream>
#include<iostream>
#include<string>
#include<queue>
#include<algorithm>
#include<set>
#include<map>
#include<cmath>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<vector>
#define INF (1<<21)
using namespace std;
typedef pair<int,int> P;

//ここまで基本型、多少の変更はあるけどまあいける

int main()
{
	int a[4],b[4];
	int asum,bsum;


	cin >>a[0]>>a[1]>>a[2]>>a[3];
	cin >>b[0]>>b[1]>>b[2]>>b[3];

	asum=a[0]+a[1]+a[2]+a[3];
	bsum=b[0]+b[1]+b[2]+b[3];

	int high;

	high=asum;
	if (bsum>asum) {high = bsum;}
	
	cout<<high<<endl;

	return 0;
}

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

using namespace std;

int main()
{
	int A1, B1, C1, D1, A2, B2, C2, D2;

	cin >> A1 >> B1 >> C1 >> D1 >> A2 >> B2 >> C2 >> D2;

	cout << max(A1 + B1 + C1 + D1, A2 + B2 + C2 + D2) << endl;

	return 0;
}

C++: #include <cstdio>
using namespace std;
int main()
{
int a,b,x;
for(int i=0;i<8;i++){scanf("%d",&x); if(i<=3) a+=x; else b+=x;}
printf("%d\n",max(a,b));
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb(in,tmp) in.push_back(tmp)
#define all(in) in.begin(),n.end()
#define PI acos(-1)
using namespace std;
int main(){

  int a[2]={0};
  rep(i,2){
    rep(j,4){
      int tmp;
      cin>>tmp;
      a[i]+=tmp;
    }
  }
  if(a[0]==a[1])cout<<a[0]<<endl;
  else cout<<max(a[0],a[1])<<endl;



}

C++: #include <iostream>
using namespace std;
int main() {
	while (true) {
		int a, b, c = 0, d = 0;
		for (int i = 0; i < 4; i++) {
			cin >> a;
			c = c + a;
		}
		for (int i = 0; i < 4; i++) {
			cin >> b;
			d = d + b;
		}
		if (c < d)
			cout << d << endl;
		else {
			cout << c << endl;
		}
	}
	return 0;
}

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

int main() {
  int a1,a2,a3,a4,b1,b2,b3,b4,atot,btot;
  cin >> a1 >> a2 >> a3 >> a4 >> b1 >> b2 >> b3 >> b4;
  atot = a1 + a2 + a3 + a4;
  btot = b1 + b2 + b3 + b4;
  if( atot > btot)
    cout << atot << endl;
  else
    cout << btot << endl;
}

C++: #include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int main() {
	int a[2] = { 0 };
	for (int i = 0; i < 2; i++) {
		int a, b, c, d;
		cin >> a >> b >> c >> d;
		a[i] += (a + b + c + d);
	}
	cout << max(a[0], a[1]) << endl;
}

C++: #include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int a,b,c,d,e,f,g,h;
    cin >>a>>b>>c>>d;
    cin >>e>>f>>g>>h;
    int t=a+b+c+d;
    int s=e+f+g+h;
    if(s>t){
        cout<<s;
    }
    else{
        cout<<t;
    }
    cout<<endl;
}