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 <iostream>
using namespace std;
int main() 
{
	int a, b, c, d, e, f, g, h, A, B;
	cin >> a >> b >> c >> d;
	cin >> e >> f >> g >> h;
	A = a + b + c + d;
	B = e + f + g + h;
	if (A >= B) {
		cout << A << endl;
	}
	else
		cout << B << endl;
	return 0;
}

C++: // Example program
#include <iostream>
#include <string>
#include<vector>
#include<algorithm>
using namespace std;


int main()
{
int s=(a+b+c+d);
int t=(e+f+g+h);
int a;
int b;
int c;
int d;
int e;
int f;
int g;
int h;

cin >> a;
cin >> b;
cin >> c;
cin >> d;
cin >> e;
cin >> f;
cin >> g;
cin >> h;


if(s>t){
    cout << s << endl;
}else{
    cout << t << endl;
}
}

C++: #include<iostream>
#include<algorithm>
#include<string.h>
#include<vector>
using namespace std;
int main()
{
	int a[5]={},b[5]={},ans;
	for(int w=0;w<4;w++){
		cin>>a[w];
		a[4]=a[4]+a[w];
	}
	for(int w=0;w<4;w++){
		cin>>b[w];
		b[4]=b[4]+b[w];
	}
	if(a[4]>=b[4]) cout<<a[4]<<endl;
	else cout<<b[4]<<endl;
}

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

int main(void)
{
  int buf;
  int a_sum = 0;
  int b_sum = 0;
  for (int i = 0; i < 4; i++)
  {
    cin >> buf;
    a_sum += buf;
  }

  for (int i = 0; i < 4; i++)
  {
    cin >> buf;
    b_sum += buf;
  }

  cout << ( a_sum < b_sum ? b_sum : a_sum) << endl;
  return 0;
}

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

int main(){

	int a=0,b=0;

	for(int i = 0;i < 4;i++){
		int tmp=0;
		scanf("%d",&tmp);
		a += tmp;
	}
	for(int i = 0;i < 4;i++){
		int tmp = 0;
		scanf("%d",&tmp);
		b += tmp;
	}
	printf("%d\n",max(a,b));

	return 0;
}

C++: // 2011/12/01 Tazoe

#include <iostream>
using namespace std;

int main()
{
	int a1, a2, a3, a4;
	cin >> a1 >> a2 >> a3 >> a4;
	int b1, b2, b3, b4;
	cin >> b1 >> b2 >> b3 >> b4;

	int S = a1+a2+a3+a4;
	int T = b1+b2+b3+b4;

	if(S>=T)
		cout << S << endl;
	else
		cout << T << endl;

	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c,d;
  int sum1,sum2;
  cin>>a>>b>>c>>d;
  sum1=a+b+c+d;
  cin>>a>>b>>c>>d;
  sum2=a+b+c+d;
  cout<<max(sum1,sum2)<<endl;
  return 0;
}

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

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

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

int main(){
    int a=0,b=0;
    for(int i=0;i<8;i++){
        int x;cin >> x;
        if(i<4)a+=x;
        else b+=x;
    }
    cout << ((a<b)?b:a) << endl;
}

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

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

#include<fstream>
#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 paair<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=asum;
	if (bsum>asum) high = bsum;
	
	cout<<high<<\n;

	return 0;
}

C++: #include<cstdio>
#include<algorithm>
#include<numeric>
using namespace std;
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]);
  printf("%d\n",max(accumulate(a,a+4,0),accumulate(b,b+4,0)));
  return (0);
}

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

int main() {
	int A[8];
	int n = 0;
	while (n < 8) {
		cin >> A[n];
		n++;
	}
	int M = A[0] + A[1] + A[2] + A[3];
	int N = A[4] + A[5] + A[6] + A[7];
	if (M > N) {
		cout << M << endl;
	}
	else {
		cout << N << endl;
	}
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
  int sum[2] = { 0 };
  int point;

  for(int i = 0;i < 2;i++){
    for(int j = 0;j < 4;j++){
      cin >> point;
      sum[i] += point;
    }
  }
  if(sum[0] > sum[1])cout << sum[0] << endl;
  else if(sum[0] < sum[1])cout << sum[1] << endl;
  else cout << sum[0] << endl;
}

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

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

using namespace std;

int main(){

  int Ai,Am,As,Ae;
  int Bi,Bm,Bs,Be;

  int S,T;

  cin >> Ai >> Am >> As >> Ae >> Bi >>Bm >> Bs >> Be;

  S=Ai+Am+As+Ae;
  T=Bi+Bm+Bs+Be;

  if(S>=T){
    cout << S << endl;
  }
  else{
    cout << T << endl;
  }
  
  return 0;
}

C++: #include<iostream>
#include<string>
#include<cmath>
#include<algorithm>
using namespace std; 
int main(){
  int a,b,c,d;
  int w,x,y,z;
  cin>>a>>b>>c>>d;
  cin>>w>>x>>y>>z;
  int A=a+b+c+d;
  int B=w+x+y+z;
  if(A>B) cout<<A<<endl;
  else if(A<B) cout<<B<<endl;
  else  cout<<A<<endl;
  
return 0;
}

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

using namespace std;

int main()
{
    int n;
    int a, b;
    int i;

    a = b = 0;
    for (i = 0; i < 8; i++){
        scanf("%d", &n);

        if (i < 4){
            a += n;
        }
        else {
            b += n;
        }
        printf("%d\n", max(a, b));
    }

    return (0);
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
	int ai,am,as,ae,bi,bm,bs,be;
	cin>>ai>>am>>as>>ae>>bi>>bm>>bs>>be;
	cout<<max(ai+am+as+ae,bi+bm+bs+be)<<endl;
}

C++: #include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
using namespace std;
using Graph = vector<vector<int>>;
typedef pair<int,int> P;
typedef long long ll;

int main(){
    int a, b, c, d; cin >> a >> b >> c >> d;
    int e, f, g, h; cin >> e >> f >> g >> h;

    ll ans1 = a + b + c + d;
    ll ans2 = e + f + g + h;

    cout << max(ans1, ans2) << endl;
    
}

C++: #include<bits/stdc++.h>
using namespace std;
int sc(int a,int b,int c,int d){
    return a+b+c+d;
}
int main(void){
    int infA,mathA,sciA,engA;
    int infB,mathB,sciB,engB;
    cin>>infA>>mathA>>sciA>>engA;
    cin>>infB>>mathB>>sciB>>engB;
    int S=sc(infA,mathA,sciA,engA);
    int T=sc(infB,mathB,sciB,engB);
    if(S>T){
        cout<<S<<endl;
    }else if(S<T){
        cout<<T<<endl;
    }else if(S==T){
        cout<<S<<endl; /*cout<<T<<endl;*/
    }
    return 0;
}

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

int main {
    int S=0, T=0, a, b, i;
     for(i=0; i<4; i++) {
         cin >> a;
         S += a;
     }
     for(i=0; i<4; i++) {
         cin >> b;
         T += b;
     }
     cout << S > T ? S : T;
}

C++: #include<stdio.h>
int main(void)
{
	int a,b,c,d,e,f,g,h,x,y;
	scanf("%d %d %d %d",&a,&b,&c,&d);
	scanf("%d %d %d %d",&e,&f,&g,&h);
	x=a+b+c+d;
	y=e+f+g+h;
	if(x>y || x==y) {
		printf("%d\n",x);
	}
	else {
		printf("%d\n",y);
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main() 
{
	int a, b, c, d, e, f, g, h, A, B;
	cin >> a >> b >> c >> d;
	cin >> e >> f >> g >> h;
	A = a + b + c + d;
	B = e + f + g + h;
	if (A >= B) {
		cout << A << endl;
	}
	else
		cout << B << endl;
	return 0;
}