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,ASUM=0,BSUM=0;
  for(int i=0;i<4;i++){
    cin >> A;
    ASUM+=A;
  }for(int i=0;i<4;i++){
    cin >> B;
    BSUM+=B;
  }
  if(A>=B)cout << ASUM << endl;
  if(A<B)cout << BSUM << endl;
  return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

int main()
{
//	cut here before submit 
//	freopen ("testcase.score", "r", stdin );
	string str = "";

	vector <vector <int> > score (2, vector <int> (4, 0 ) );
	int i, j;

	for (i = 0; i < 2; ++i){
		getline (cin, str );
		stringstream ss(str);
		
		for (j = 0; j < 4; ++j){
			ss >> score[i][j];
		} // end for
	} // end for
	
	vector <int> total (2, 0 );

	for (i = 0; i < 2; ++i){
		 total[i] = accumulate (score[i].begin(), score[i].end(), 0 );
	} // end for
	
	cout << max (total[0], total[1] ) << endl;

	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
 
#define int long long
//#define uint __int128_t
 
#define pb push_back
#define fi first
#define se second
#define rep(i,s,n) for(int i = s;i<n;i++)
#define rrep(i,s,n) for(int i = (n)-1;i>=(s);i--)
#define all(v) (v).begin(),(v).end()
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0)
typedef long long ll;
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<vint> vvint;
typedef vector<pint>vpint;
typedef pair<pint,int> P1;
typedef pair<int,pint> P2;
typedef pair<pint,pint> PP;
const ll MOD=1000000007;
const ll INF=1e18;

int a,b,c,d;
int ans=0;
signed main() {
    IOS();
    //(1ll<<N)シフト演算のオーバーフローに気をつける
    //MOD同士の引き算に注意
    rep(i,0,2){
        cin>>a>>b>>c>>d;
        chmax(ans,a+b+c+d);
    }
    cout<<ans<<endl;
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    return 0;
}

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

C++: #include <stdio.h>
int a,b,c,i;main(){for(;i<4;i++,scanf("%d",&a),b+=a);for(;~scanf("%d",&a);c+=a);printf("%d\n",b>c?b:c);}

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

int main()
{
    int x=0,a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,y=0;
    cin>>a>>b>>c>>d;
    cin>>e>>f>>g>>h;
    x=a+b+c+d;
    y=e+f+g+h;
    if(x>y){
        cout<<x<<endl;
    }else{
        cout<<y<<endl;
    }
    
}

C++: #include<stdio.h>
int main(void)
{
	int s,ss,sss;
	while(1){
		scanf("%d",&s);
		if(s==0) break;
		ss=1000-s;
		sss=ss/500;
//		printf("500sss=%d\n",sss);
		ss=ss%500;
		sss+=ss/100;
//				printf("100sss=%d\n",sss);
		ss=ss%100;
		sss+=ss/50;
//				printf("50sss=%d\n",sss);
		ss=ss%50;
		sss+=ss/10;
//				printf("10sss=%d\n",sss);
		ss=ss%10;
		sss+=ss/5;
//				printf("5sss=%d\n",sss);
		ss=ss%5;
		sss+=ss/1;
//				printf("1sss=%d\n",sss);
//		sss++;
	printf("%d\n",sss);
	}
	return 0;
}

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

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

int main(void){
	int i,j,x,s[2]={0,0};

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

	return 0;
}

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

int main(){
int a;int b;
int i = 1;
int s;int d;int j;int k;
cin >> s >> d >> j >> k;
a = s+d+j+k;
int w;int ww;int www;int wwww;
cin >>w >> ww >> www >> wwww;
b = w + ww + www + wwww;
if(a >= b){
cout >> a >>endl;
}
else{
cout >> b >> endl;
}
}
    return 0;
}

C++: #include <iostream>

using namespace std;

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

C++: #include <iostream>

using namespace std;

int main() {
	int a, b, c, d;
	int max = 0;
	for (int i = 0; i < 2; ++i) {
		cin >> a >> b >> c >> d;
		int sum = a + b + c + d;
		if (sum > max) sum = max;
	}
	cout << max << endl;
	return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<iomanip>
using namespace std;
#define pi 3.141592653589793283462
int main(){
	int Aa,Ab,Ac,Ab;
	int ba,bb,bc,bd;
	int p,q;
	cin>> Aa>>Ab>>Ac>>Ab;
	cin>> ba>>bb>>bc>>bd;
	p=Aa+Ab+Ac+Ab;
    q=ba+bb+bc+bd;
	if(p<q)
		cout<<q<<endl;
	else if(p>q)
		cout<<p<<endl;
	else
		cout<<p<<endl;
	return 0;
}

C++: #include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define INF (1<<29)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define CLR(a) memset(a,0,sizeof(a))
const int dx[] = {-1,0,0,1},dy[] = {0,1,-1,0};

typedef long long int ll;

using namespace std;

int main(){
    int ans = 0;
    REP(i,4){
	int t;
	cin >> t;
	ans += t;
    }
    int s = 0;
    REP(i,4){
	int t = 0;
	cin >> t;
	s += t;
    }
    ans = max(ans,s);
    cout << ans << endl;
    return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <cstring>
#include <cmath>

#define max(a,b) (a>b)?a:b
using namespace std;

int main(int args, char *argc[]){
  int a,b,c,d;
  int q,w,e,r;
  cin>>a>>b>>c>>d;
  cin>>q>>w>>e>>r;
  int suma=a+b+c+d;
  int sumb=q+w+e+r;
  cout<<(max(suma,sumb))<<endl;
  return 0;
}

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

using namespace std;

int main()
{
	int s[4],t[4];
	for(int i=0;i<4;i++)	cin>>s[i];
	for(int i=0;i<4;i++)	cin>>t[i];
	s[0]=accumulate(s,s+4,0);
	t[0]=accumulate(t,t+4,0);
	cout<<(s[0]<t[0]?t[0]:s[0])<<endl;
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const ll mod=998244353,MAX=200001,INF=1<<30;

int main(){
  int 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;
}

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

using namespace std;

int main(void) {
    int a, b, A = 0, B = 0;
    for (int i = 0; i< 4; i++) {
        cin >> a;
        A += a;
    }
    for (int i = 0; i< 4; i++) {
        cin >> b;
        B += b;
    }

    cout << max(A, B) << endl;

    return 0;
}

C++: #include <iostream>
#define MAX ((a)>(b)?(a):(b))
using namespace std;

int main(void){
	int 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;
}