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

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

int main(int argc, char const *argv[]) {
	int a[4];
	int b[4];
	for (int i = 0; i < 4; i++){
		cin >> a[i];
	}
	for (int i = 0; i < 4; i++){
		cin >> b[i];
	}
	int a_sum = 0;
	int b_sum = 0;

	for (int i = 0; i < 4; i++){
		a_sum = a_sum + a[i];
	}
	for (int i = 0; i < 4; i++){
		b_sum = b_sum + b[i];
	}
	if (a_sum < b_sum){
		cout << b_sum << endl;
	}
	else{
		cout << a_sum << endl;
	}
	return 0;
}

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; 
 int t;
 s=(a+b+c+d);
 t=(e+f+g+h);
 
 if(s<t){
     cout << "t" << endl;
 }
 if(t<s){
     cout << "s" << endl;
 }
 if(s==t){
     cout << "t" << endl;
 }
}

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

using namespace std;

    struct A{
        int score[5];
        int ans;
    } A;

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

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

typedef long long ll;
typedef pair<int, int> P;
#define MOD 1000000007
#define INF (1 << 30)
#define REP(i, m, n) for(int i = (int)m; i < (int)n; ++i)
#define rep(i, n) REP(i, 0, n)


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

    int sumA = 0, sumB = 0;
    rep(i, 4) {
        int a; cin >> a;
        sumA += a;
    }
    rep(i, 4) {
        int b; cin >> b;
        sumB += b;
    }
    cout << max(sumA, sumB) << '\n';
    return 0;
}

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

C++: #include<bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};
 
#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--)

int main(){
    int ai,am,as,ae,bi,bm,bs,be;
    scanf("%d%d%d%d%d%d%d%d",&ai,&am,&as,&ae,&bi,&bm,&bs,&be);
    int S = ai + am + as + ae;
    int T = bi + bm + bs + be;
    printf("%d\n",S > T ? S : T);
    return 0;
}

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

int main(){int s = 0, t = 0, temp;for(int i = 0; i < 4; ++i) {scanf("%d", &temp);s += temp;}for(int i = 0; i < 4; ++i) {scanf("%d", &temp);t += temp;printf("%d\n", max(s, t));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 <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <map>
#define INF 100000000

using namespace std;
typedef long long ll;

int main(){
	int sum[2];
	sum[0]=sum[1]=0;
	for(int i=0;i<2;i++){
		for(int j=0;j<4;j++){
			int a;
			cin>>a;
			sum[i]+=a;
		}
	}
	cout<<max(sum[0],sum[1])<<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(s<ss){
		printf("%d\n",ss);
	}
	else{
		printf("%d\n",s);
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
	int main(){
	int sum1=0,sum2=0;
	for(int i=0;i<4;i++){
	cin>>a;
	sum1+=a;
}
for(int i=0;i<4;i++){
	cin>>a;
	sum2+=sum2;
}
	if(sum1>sum2)cout<<sum1;
	else if(sum1<sum2)cout<<sum2;
	else cout<<sum1;

return 0;
}

C++: #include<stdio.h>
int main()
{
	int tensu[2];
	int a,b,c,d,i;

	for(i=0;i<2;i++)
	{
		scanf("%d %d %d %d",&a,&b,&c,&d);
		tensu[i]=a+b+c+d;
	}

	if(tensu[0]<tensu[1])
	{
		printf("%d",tensu[1]);
	}
	else if(tensu[0]>tensu[1])
	{
		printf("%d",tensu[0]);
	}
	else
	{
		printf("%d\n",tensu[0]);
	}
	return 0;
}

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++: #define _USE_MATH_DEFINES
#define INF 100000000
#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>

using namespace std;

typedef long long ll;
typedef pair <int,int> P;

static const double eps = 1e-8;

int main(){
	int n;
	while(~scanf("%d",&n)){
		int res=0;
		for(int i=0;i<2;i++){
			int sum = 0;
			for(int j=0;j<4;j++){
				int p;
				scanf("%d",&p);
				sum += p;
			}
			res = max(sum,res);
		}

		printf("%d\n",res);
	}
}

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

int main()
{
	int j1, m1, s1, e1;
	std::cin >> j1 >> m1 >> s1 >> e1;
	int s = j1 + m1 + s1 + e1;

	int j2, m2, s2, e2;
	std::cin >> j2 >> m2 >> s2 >> e2;
	int t = j2 + m2 + s2 + e2;

	std::cout << std::max(s, t) << std::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;
  if(sum[0] < sum[1])cout << sum[1] << endl;
  else cout << sum[0] << endl;
}

C++: #include <cstdio>
int main (int argc, char const* argv[])
{
	int S=0,T=0,P;
	for(int i=0;i<4;i++) {
		scanf("%d",&P);
		S+=P;
	}
	for(int i=0;i<4;i++) {
		scanf("%d",&P);
		T+=P;
	}
	printf("%d\n",S>=T?S:T);
	return 0;
}