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(void){
    int a,b,c,d;
    int e,f,g,h;
    cin>>a>>b>>c>>d;
    cin>>e>>f>>g>>h;
    
    int S=a+b+c+d;
    int T=e+f+g+h;
    
    if(S>T){
        cout<<S<<endl;
    }
    
    else{
        cout<<T<<endl;
    }
}

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

C++: import java.util.*;

class Score {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int res = 0;
		for(int i = 0; i < 2; i++) {
			int sum = 0;
			for(int j = 0; j < 4; j++) {
				int tmp;
				tmp = sc.nextInt();
				sum = sum + tmp;
			}
			if(res < sum)
				res = sum;
		}
		System.out.println(res);
	}
}

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

C++: #include<stdio.h>
int main(void)
{
	int x1,x2,x3,x4,y1,y2,y3,y4,s,t;
	scanf("%d %d %d %d %d %d %d %d",&x1,&x2,&x3,&x4,&y1,&y2,&y3,&y4);
	s=x1+x2+x3+x4;
	t=y1+y2+y3+y4;
	if(s>t){
		printf("d\n",s);
	}
	else if(s<t){
		printf("%d\n",t);
	}
	else if(s==t){
		printf("%d\n",t);
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(ll i=(n)-1;i>=0;i--)
#define range(i,a,n) for(ll i=(a);i<(n);i++)
#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI (3.1415926535897932384)

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};
template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S sum(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}

template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>void tf(bool b,S t,T f){if(b)puta(t);else puta(f);}
void YN(bool b){tf(b,"YES","NO");}
void Yn(bool b){tf(b,"Yes","No");}
void yn(bool b){tf(b,"yes","no");}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1;for(auto s:t){os<<(a?"":" ")<<s;a=0;}return os;}
template<class S>auto&operator>>(istream&is,vector<S>&t){for(S&a:t)cin>>a;return is;}

/*他のライブラリを入れる場所*/


int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	vl a(4),b(4);
	cin>>a>>b;
	puta(max(sum(a),sum(b)));
	return 0;
}

C++: #include <iostream>
using namespace std;
int main()
{
	int a[4], b[4];
	cin >> a[0] >> a[1] >> a[2] >> a[3];
	cin >> b[0] >> b[1] >> b[2] >> b[3];
	if (a[0] + a[1] + a[2] + a[3] >= b[0] + b[1] + b[2] + b[3])
		cout << a[0] + a[1] + a[2] + a[3] << endl;
	else
		cout << b[0] + b[1] + b[2] + b[3] << endl;
	return 0;
}

C++: #include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#define REP(i,m,n) for(int i = (int) (m);i < (int) (n);i++)
#define rep(i,n) REP(i,0,n)
using namespace std;

int x[5], y[5];
int X, Y;


int main() {

	rep(i, 4) {
		cin >> x[i];
		X += x[i];
	}
	rep(i, 4) {
		cin >> y[i];
		Y += y[i];
	}
	if (X >= Y) cout << X << endl;
	else cout << Y << endl;






	return 0;
}

C++: #include <cstdio>
main(){
	int a[4],ar,br;
	scanf("%d%d%d%d",a,a+1,a+2,a+3);
	ar=*a+a[1]+a[2]+a[3];
	scanf("%d%d%d%d",a,a+1,a+2,a+3);
	br=*a+a[1]+a[2]+a[3];
	printf("%d\n",ar>br?ar:br);
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int A[10],a,b;
  for(int i=0;i<=8;i++){
    cin>>A[i];
  }
  a=A[0]+A[1]+A[2]+A[3];
  b=A[4]+A[5]+A[6]+A[7];
  if(a>=b)cout<<a<<endl;
  else cout<<b<<endl;

 return 0;
}

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

int main(int argc, const char * argv[]) {
    
    int a[5],b[5];
    int s=0;
    int t=0;
    
    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=s+a[i];
        t=t+b[i];
    }
    
    if(s>=t){
        cout << s << endl;
    }
    else{
        cout << t << endl;
    }
    
    
    return 0;
}

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

int main(){
  int ai,am,ac,ae;
  int bi,bm,bc,be;
  
  scanf(" %d %d %d %d",&ai,&am,&ac,&ae);
  scanf(" %d %d %d %d",&bi,&bm,&bc,&be);
  
  printf("%d\n",max(ai+am+ac+ae,bi+bm+bc+be));
  
  return 0;
}

C++: import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		
		int[] a = new int[4];
		int[] b = new int[4];
		
		int sumA = 0, sumB = 0;
		
		for(int i = 0; i < 4; i++){
			a[i] = in.nextInt();
			sumA += a[i];
		}
		
		for(int i = 0; i < 4; i++){
			b[i] = in.nextInt();
			sumB += b[i];
		}
		
		if(sumA < sumB){
			System.out.println(sumB);
		}
		else{
			System.out.println(sumA);
		}
		
	}
}

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

using namespace std;

int A,B,score;

int main(void){

  while( cin >> score ){

    A = B = 0;
    A += score;
    for( int i = 0 ; i < 3 ; i++ ){
      cin >> score;
      A += score;
    }
    for( int i = 0 ; i < 4 ; i++ ){
      cin >> score;
      B += score;
    }
    cout << max( A , B ) << endl;

  }
  return 0;
}

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

int main() {
	int S,P,w,x,y,z,a,b,c,d;
	cin>>w>>x>>y>>z;
	S=w+x+y+z;
	cin>>a>>b>>c>>d;
	P=a+b+c+d;
	if(S==P){
		cout<<S<<endl;
	}
	else
	{int q = max(S,P);
	cout<<q<<endl;
	}
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int a,b,s,ss,i;
	for(i=0;i<4;i++){
		scanf("%d",&a);
		s+=a;
	}
	for(i=0;i<4;i++){
		scanf("%d",&b);
		ss+=b;
	}
	if(s>ss){
		printf("%d\n",s);
	}
	else if(ss>s){
		printf("%d\n",ss);
	}
	else{
		printf("%d\n",s);
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(void){
    int a,b,c,d,e,f,g,h;
    cin>>a>>b>>c>>d;
    cin>>e>>f>>g>>h;
    if(a+b+c+d<e+f+g+h){
        cout<<e+f+g+h<<endl;
    }
    else{
        cout<<a+b+c+d<<endl;
    }
   
    
}

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

int main(void) {
    int a,suma=0,sumb=0;
    for (int i=0;i<4;i++) {
        cin>>a;
        suma+=a;
    }
    for (int j=0;j<4;j++) {
        cin>>a;
        sumb+=a;
    }
    if (suma>sumb) {
        cout<<suma<<endl;
    } else if (suma<sumb) {
        cout<<sumb<<endl;
    } else if (suma==sumb) {
        cout<<suma<<endl;
    }
}