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++: /*
	AOJ 0510 JOI yo 2005 2006 1 Score
*/

//ミスを防ぐためにまずは基本のIncludeをすべて格納する

#include<fstream>
#include<string>
#include<queue>
#include<algorithm>
#include<set>
#include<map>
#include<cmath>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<vector>
#define INF (1<<21)
using namespace std;
typedef paair<int,int> P;

//ここまで基本型、多少の変更はあるけどまあいける

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


	cout >>a[0]>>a[1]>>a[2]>>a[3];
	cout >>b[0]>>b[1]>>b[2]>>b[3];

	asum=a[0]+a[1]+a[2]+a[3];
	bsum=b[0]+b[1]+b[2]+b[3];

	int high

	high=asum;
	if (bsum>asum) {high = bsum;}
	
	cin<<high<<\n;

	return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int a1,b1,c1,d1,a2,b2,c2,d2,A,B;
    cin>>a1>>b1>>c1>>d1>>a2>>b2>>c2>>d2;
    A=a1+b1+c1+d1;
    B=a2+b2+c2+d2;
    if(A>B){
        cout<<A<<endl;
    }
    else{
        cout<<B<<endl;
    }
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <functional>
#include <cstring>
#include <queue>
using namespace std;
int main() {
	int a, b, c, d, e, f, g, h;
	scanf("%d%d%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f, &g, &h);
	int num = a + b + c + d, fail = e + f + g + h;
	printf("%d\n", max(num, fail));
}

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

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define For(i,a,b) for(int (i)=(a); (i)<(b); (i)++)

int main() {
    int A = 0;
    int B = 0;
    REP(i,4) {
        int j;
        cin >> j;
        A += j;
    }
    REP(i,4) {
        int j;
        cin >> j;
        B += j;
    }
    cout << max(A, B) << endl;
    return 0;
}

C++: #include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<string>
#include<vector>
#include<queue>

#define rep(i,j) for(int i=0;i<(j);i++)

using namespace std;

typedef pair<int,int> pii;

int main(){
	int a,b[2]={0};
	rep(i,2)rep(j,4){
	    scanf("%d",&a);
	    b[i]+=a;
    }
	printf("%d\n",max(b[0],b[1]));
	return 0;
}

C++: #include <stdio.h>

main()
{
	int a,b,c,d;
	scanf("%d %d %d %d", &a,&b,&c,&d);
	int e,f,g,h;
	scanf("%d %d %d %d", &e,&f,&g,&h);
	int S,T;
	S = a + b + c + d;
	T = e + f + g + h;
	if (S>T) printf("%d\n",S);
	else	 printf("%d\n",T);
}

C++: #include<iostream>

using namespace std;

int main(){
	
	int i ,a, sum1=0,sum2=0;
	
	for(i=0;i<4;i++){
		cin >> a;
		sum1+= a;
	}
	for(i=0;i<4;i++){
		cin >> a;
		sum2+= a;
	}
	if(sum1>=sum2)cout<<sum1<<endl;
	else cout<<sum2<<endl;
	
	return 0;
	
}

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

using namespace std;

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

C++: #include <iostream>

using namespace std;

void solve()
{
	int sum1 = 0;
	int sum2 = 0;
	for(int i = 0; i < 4; ++i)
	{
		int temp;
		cin >> temp;
		sum1 += temp;
	}
	for(int i = 0; i < 4; ++i)
	{
		int temp;
		cin >> temp;
		sum2 += temp;
	}
	if(sum1 >= sum2)
	{
		cout << sum1 << endl;
	}
	else
	{
		cout << sum2 << endl;
	}
}

int main()
{
	solve();
	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++: #include <iostream>

int main ()
{
    int a_info, a_math, a_sci, a_eng;
    int b_info, b_math, b_sci, b_eng;

    std::cin >> a_info;
    std::cin >> a_math;
    std::cin >> a_sci;
    std::cin >> a_eng;
    std::cin >> b_info;
    std::cin >> b_math;
    std::cin >> b_sci;
    std::cin >> b_eng;

    int a_S,b_S;

    a_S = a_info + a_math + a_sci + a_eng;
    b_S = b_info + b_math + b_sci + b_eng;


    if (a_S >= b_S) {
        std::cout << a_S << std::endl;
    } else {
        std::cout << b_S << std::endl;
    }

    return 0;
}

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

int main(){
	int score;
	int total_a = 0, total_b = 0;
	for(int i=0; i < 4; i++){
		cin >> score;
		total_a += score;
	}
	for(int i=0; i < 4; i++){
		cin >> score;
		total_b += score;
	}
	cout << max(total_a, total_b) << endl;
}

C++: #include<cstdio>
using namespace std;
template<typename T>
T max(T a, T b){
  if(a > b)
    return a;
  return b;
}
int main(){
  int T{};
  int S{};
  int data;
  for(int i{} ; i < 4 ; i++){
    scanf("%d",&data);
    T += data;
  }
  for(int i{} ; i < 4 ; i++){
    scanf("%d",&data);
    S += data;
  }
  printf("%d\n",max(T,S));
}

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

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

using namespace std;

int main() {
	int A=0, B=0, t;

	for (int i = 0; i < 4; i++) {
		scanf("%d", &t);
		A += t;
	}
	for (int i = 0; i < 4; i++) {
		scanf("%d", &t);
		B += t;
	}

	printf("%d", max(A, B));

	return 0;
}

C++: #include <iostream>
#include <cassert>
#define REP(i,l,n) for(int i=l;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define MAX 10000
int sumA=0,sumB=0;
int a[4],b[4];
using namespace std;
int main() {
  rep(i,4) cin >> a[i];
  rep(i,4) cin >> b[i];
  rep(i,4) sumA += a[i];
  rep(i,4) sumB += b[i];
  if(sumB>sumA){
    cout << sumB << endl;
  }else{
    cout << sumA << 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 %d %d %d %d",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4);
	s=a1+a2+a3+a4;
	t=b1+b2+b3+b4;
	if(s<=t){
		printf("%d\n",t);
	}
	else if(t<=s){
		printf("%d\n",s);
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(void)
{
    int z[3],m[3],s[3],e[3],A[3];
    for(int i=0;i<2;i++){
        cin>>z[i]>>m[i]>>s[i]>>e[i];
        A[i]=z[i]+m[i]+s[i]+e[i];
        if(i==1&&A[i]>A[0])A[0]=A[i];
    }
    cout<<A[0]<<"\n";
}

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

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

C++: #include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;

int main() {
	int S = 0; rep(i, 4) { int a; scanf("%d", &a); S += a; }
	int T = 0; rep(i, 4) { int a; scanf("%d", &a); T += a; }
	cout << max(S, T) << endl;
	return 0;
}