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 <bits/stdc++.h>
using namespace std;

#define times(n, i)      uptil(0, n, i)
#define upto(f, t, i)    for(decltype(t) _##i = (t), i = (f); i <= _##i; i++)
#define uptil(f, t, i)   for(decltype(t) _##i = (t), i = (f); i < _##i; i++)
#define downto(f, t, i)  for(decltype(t) _##i = (t), i = (f); i >= _##i; i--)
#define downtil(f, t, i) for(decltype(t) _##i = (t), i = (f); i > _##i; i--)
#define unless(c) if(!(c))
#define until(c) while(!(c))
#define loop while(true)

#define all(v) v.begin(), v.end()
#define ln << "\n"

struct line{};

template<class T> istream& operator>>(istream& in, vector<T>& v) {
    times(v.capacity(), i) in >> v[i];
    return in;
}

template<class T> const ostream& operator<<(ostream& out, const vector<T>& v) {
    times(v.size(), i) out << (i ? " " : "") << v[i];
    return out;
}

template<class T, class...U> typename enable_if<is_same<T, line>::value, string>::type next(istream& in, const U&... args) {
    string s;
    getline(in, s, args...);
    return move(s);
}

template<class T, class...U> typename enable_if<!is_same<T, line>::value, T>::type next(istream& in, const U&... args) {
    T t(args...);
    in >> t;
    return move(t);
}
template<class T, class...U> auto next(const U&... args) -> decltype(next<T>(cin)) {
    return next<T>(cin, args...);
}

template<class T> T sum(const vector<T>& v) {
    T ans = T();
    for(const T& t : v) ans += t;
    return ans;
}

template<class T> T sum(const typename vector<T>::iterator& begin, const typename vector<T>::iterator& end) {
    T ans = T();
    for(typename vector<T>::iterator t = begin; t != end; t++) ans += *t;
    return ans;
}

template<class T> T min(const vector<T>& v) {
    return *min_element(v.begin(), v.end());
}

template<class T> T min(const typename vector<T>::iterator& begin, const typename vector<T>::iterator& end) {
    return *min_element(begin, end);
}

template<class T> T max(const vector<T>& v) {
    return *max_element(v.begin(), v.end());
}

template<class T> T max(const typename vector<T>::iterator& begin, const typename vector<T>::iterator& end) {
    return *max_element(begin, end);
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    cout << max(sum(next<vector<int>>(4)), sum(next<vector<int>>(4))) ln;

    return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	int a[8];
	for (int i = 0; i < 8; i++) {
		cin >> a[i];
	}
	if (a[0] + a[1] + a[2] + a[3] > a[4] + a[5] + a[6] + a[7])cout << a[0] + a[1] + a[2] + a[3] << endl;
	else cout << a[4] + a[5] + a[6] + a[7]<<endl;
}

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

using namespace std;

inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str();}

typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;

#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EACH(t,i,c) for(t::iretator i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

const double EPS = 1e-10;

int main() {
	int a = 0, b = 0, tmp;

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

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

	cout << ((a>b) ? a : b) << endl;

	return 0;
}

C++: #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
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++: ////////////////////////////
//情報オリンピック過去問////
//Score				 ////
//AOJ 0510			  ////
////////////////////////////

/*
 *設問解説
 *情報・数学・理科・英語のAさんBさんの合計得点
 *のうち大きい方を出力
 *同点の場合は、どちらか片方を出力
*/

#include<cstdio>
using namespace std;

int main(){
	int aa,ab,ac,ad;
	int ba,bb,bc,bd;
	int asum,bsum,abmax;

	scanf("%d %d %d %d",&aa,&ab,&ac,&ad);
	scanf("%d %d %d %d",&ba,&bb,&bc,&bd);

	asum=aa+ab+ac+ad; bsum=ba+bb+bc+bd;	

	if(asum >= bsum){
		abmax=asum;
	}else{
		abmax=bsum;
	}
	
	printf("%d",abmax);

	return 0;

}

//end

/////////////////////////////////////////////
//解き方								   //
//	intで四科目おく					  //
//	intでaとbの得点を置く				//
//	intで最高点を置く					//
//	ifでabの大小を考えて				 //
//	最高点に代入						 //
//	最高点をprintfで出力				 //
//	簡単！							   //
/////////////////////////////////////////////

C++: #include<iostream>

int main(){
	int s[2],a;
	s[0]=0;
	s[1]=0;
	for(int i=0;i<2;++i){
		for(int j=0;j<4;++j){
			std::cin>>a;
			s[i]+=a;
		}
	}
	if(s[0]<s[1])
		std::cout<<s[1]<<std::endl;
	else
		std::cout<<s[0]<<std::endl;
	return 0;
}

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

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

class TestScore{
private:
    std::vector<int> dataset = {0,0,0,0};
public:
    void setTestScore(int info,int math,int scie,int eng);
    int getTotalScore();
};

void TestScore::setTestScore(int info,int math,int scie,int eng){
    dataset[0] = info;
    dataset[1] = math;
    dataset[2] = scie;
    dataset[3] = eng;
}

int TestScore::getTotalScore(){
    int total_score = 0;
    for(int score : dataset){
        total_score += score; 
    }
    return total_score;
}

int largeScore(int a,int b){
    if(a < b){
        return b;
    }
    return a;
}

int main(){

    TestScore ts1 = TestScore();
    TestScore ts2 = TestScore();

    int a,b,c,d;
    a = 0;
    b = 0;
    c = 0;
    d = 0;
    
    std::cout << "Input 1st Person Score!" << std::endl;
    std::cin >> a >> b >> c >> d;
    ts1.setTestScore(a,b,c,d);

    std::cout << "Input 2nd Person Score!!" << std::endl;
    std::cin >> a >> b >> c >> d;
    ts2.setTestScore(a,b,c,d);

    std::cout << largeScore(ts1.getTotalScore(),ts2.getTotalScore()) << std::endl;

    return 0;
}

C++: #include <iostream>
using namespace std;
int a,b,c,d,e,f,g,h,s,t;
int main()
{



	cin >> a >> b >> c >> d;
	cin >> e >> f >> g >> h;
	s = a+b+c+d;
	t = e+f+g+h;
	if(s > t){
		cout << s;
	}else{
		cout << t;
	}

	cout << endl;

	return 0;
}

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

int main(){
int W,X,Y,Z,w,x,y,z;
cin W,X,Y,Z,w,x,y,z;

if( (W + X + Y + Z) > (w + x + y + z)){
    cout << W + X + Y + Z << endl;
}
else if( W + X + Y + Z) < (w + x + y + z)){
    cout << w + x + y + z << endl;
}
else{ 
    cout << w + x + y + z << endl;
}

return 0;
}