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>
#include <iomanip>

using namespace std;

int solve(int m){

	int A,B,ma,i,s,e;
	
	cin>>ma>>i>>s>>e;
		
		A=ma+i+s+e;
		
	cin>>ma>>i>>s>>e;
	
		B=ma+i+s+e;
		
	if(A>B){
		return A;
	}	
	else if(A<B){
		return B;
	}
	else {return A;
	}
	return m;
}

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

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int sum = 0,sum2 = 0,tmp;
	for (int i = 0; i < 4; i++){
		cin >> tmp;
		sum += tmp;
	}
	for (int i = 0; i < 4; i++){
		cin >> tmp;
		sum2 += tmp;
	}
	cout << max(sum,sum2) <<endl;
}

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++: // Example program
#include <iostream>
#include <vector>
#include<algorithm>
using namespace std;
int main()
{
 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;
 
 int  s=(a+b+c+d); 
 int  t=(e+f+g+h);

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

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


int main(){
int s=0,t=0;
vector<int> a(4),b(4);
for(int i=0;i<4;i++)cin>>a[i];

for(int i=0;i<4;i++)cin>>b[i];

for(int i=0;i<4;i++)s+=a[i];
for(int i=0;i<4;i++)t+=b[i];
cout<<max(s,t)<<endl;

}

C++: #include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
 
//const int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
//const int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};
 
int main()
{
	int asum = 0, bsum = 0;
	int tmp;
	REP(i, 4){
		cin >> tmp;
		asum += tmp;
	}

	REP(i, 4){
		cin >> tmp;
		bsum += tmp;
	}

	cout << (asum > bsum ? asum : bsum) << endl;



}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <climits>
#include <map>
#include <set>
const int mod = 1e9 + 7;
const int inf = 1 << 20;
const long long INF = 1LL << 60;
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
using namespace std;


int main()
{
    int a = 0, b = 0;
    for(int i = 0; i < 4; i++){
        int k;
        cin >> k;
        a += k;
    }
    for(int i = 0; i < 4; i++){
        int k;
        cin >> k;
        b += k;
    }
    cout << max(a,b) << endl;
}

C++: // 2011/08/16 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 <iostream>

int a[4], b[4], s = 0,t=0;
using namespace std;

int main() {
	for (int i = 0;i < 4;i++) {
		cin >> a[i];
		s += a[i];
	}
	for (int j = 0;j < 4;j++) {
		cin >> b[j];
		t += b[j];
	}
	if (s >= t) cout << s << endl;
	else cout << t << endl;
	cin >> s;
}

C++: #include<cstdio>

int main(){
	int s=0,t=0;
	int tmp[4];
	
	scanf("%d %d %d %d",&tmp[0],&tmp[1],&tmp[2],&tmp[3]);
	for(int i=0;i<4;i++){
		s += tmp[i];
	}

	scanf("%d %d %d %d",&tmp[0],&tmp[1],&tmp[2],&tmp[3]);
	for(int i=0;i<4;i++){
		t += tmp[i];
	}

	if(s < t){
		printf("%d\n",t);
	}
	else{
		printf("%d\n",s);
	}
	return 0;
}

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

int score[2][4];
int T[2]
int main()
{
	for(int i=0;i<2;i++)
	{
		for(int j=0;j<4;j++)
		{
			cin >>score[i][j];
			T[i]+=score[i][j];
		}
	}
	if(T[1]>T[2])
	{
		cout<<T[1];
	}
	else 
	{
	cout<<T[2];
	}
}

C++: #include <stdio.h>
#include <algorithm>
#include<iomanip>

using namespace std;

int main() {
	int S = 0, T = 0, a;
	for (int i = 0; i < 4; i++)
	{
		scanf_s("%d", &a); 
		S += a;
	}
	for (int i = 0; i < 4; i++)
	{
		scanf_s("%d", &a);
		T += a;
	}
	printf_s("%d", max(S, T));
	return 0;
}

C++: #include<iostream>
#include<climits>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<stdio.h>
#include <string>
#include <complex>
#include <functional>
using namespace std;
typedef pair<int,int> P;
double dat[100][100];
int dp[6][1010];//動的計画法
int prime[10000001];
char str[1010][1010];
vector<pair<int,int> > pc[100001];
int ABS(int a){return max(a,-a);}
int main(){
	int a,b;
	int j,m,s,e;
	cin>>j>>m>>s>>e;
	a=j+m+s+e;
	cin>>j>>m>>s>>e;
	b=j+m+s+e;
	if(a>=b) cout<<a<<endl;
	else cout<<b<<endl;
    return 0;
}

C++: #include <stdio.h>

int main(void) {
    int a1, a2, a3, a4, b1, b2, b3, b4, S, T;

    scanf ("%d %d %d %d\n", &a1, &a2, &a3, &a4);    
    scanf ("%d %d %d %d\n", &b1, &b2, &b3, &b4);

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

    if (S > T) {
        printf ("%d\n", S);
    }
    else {
        printf ("%d\n", T);
    }

    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define INF 2147483647
int main(){
  int a,b=0,c=0;
  for(int i=0;i<8;i++){
    cin>>a;
    if(i<=3) b+=a;
    else c+=a;
  }
  cout<<max(b,c)<<"\n";
}

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

int main() {
  ll a,b,c,d,e,f,g,h;
  cin>>a>>b>>c>>d>>e>>f>>g>>h;
  cout<<max(a+b+c+d,e+f+g+h)<<endl;
  return 0;
}

C++: #include<cstdio>
#include<iostream>
#include<queue>
#include<stack>
#define MAX_N 100000000

using namespace std;

int main(){
    struct A{
        int score[5];
        int ans=0;
    } A;

    struct B{
        int score[5];
        int ans=0;
    } B;

    for(int i=0;i<4;++i){
        cin>>A.score[i];
        A.ans+=A.score[i];
    }

    for(int i=0;i<4;++i){
        cin>>B.score[i];
        B.ans+=B.score[i];
    }

    A.ans>=B.ans ? cout<<A.ans<<endl : cout<<B.ans<<endl;

    return 0;
}

C++: 
#include <stdio.h>
#include <string.h>
#include <functional>
#include <algorithm>
#include <string>
#include <vector>
#include <algorithm>
#include <time.h>

using namespace std;

int main (void)
{
	int a[3],b[3],A,B;

	for (int i = 0; i < 4; i++)
	{
		cin >> a[i];
		A += a[i];
	}

	for (int i = 0; i < 4; i++)
	{
		cin >> b[i];
		B += b[i];
	}

	if (A <= B)
	{
		cout << B << endl;
	}
	else if (A > B)
	{
		cout << A << endl;
	}
}

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

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

    int sum1 = 0, sum2 = 0;
    for( int i = 0; i < 4; i++ )
    {
        cin >> a[i];
        sum1 += a[i];
    }
    
    for( int i = 0; i < 4; i++ )
    {
        cin >> b[i];
        sum2 += b[i];
    }

    if( sum1 > sum2 )
        cout << sum1 << endl;
    else
        cout << sum2 << endl;

    return 0;
}

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

int main() {
	int a[4] = {}, b[4] = {};
	std::cin >> a[0] >> a[1] >> a[2] >> a[3];
	std::cin >> b[0] >> b[1] >> b[2] >> b[3];
	
	std::cout << std::max({ a[0] + a[1] + a[2] + a[3], b[0] + b[1] + b[2] + b[3] }) << std::endl;
}

C++: #include<iostream>
using namespace std;
int main(){
	int a,sum[2]={0};
	for(int i=0;i<4;i++){
		cin>>a;
		sum[0]+=a;
	}
	for(int i=0;i<4;i++){
		cin>>a;
		sum[1]+=a;
	}
	cout<<(sum[0]<sum[1]?sum[1]:sum[0])<<endl;
	return 0;
}