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>
#include <algorithm>
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 << max(a, b) << endl;
    return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int a,b,c,d,A,B,C,D,S,T;
    cin>>a>>b>>c>>d;
    cin>>A>>B>>C>>D;
     S=a+b+c+d;
     T=A+B+C+D;
    if(S==T){
        cout<<S;
    }
    else if(S>T){
        cout<<S;
    }
    else if(S<T){
        cout<<T;
    }
    cout<<endl;
}

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

int score[2][4];
int T[2];
int main()
{
	for(int i=0;i<2;i++)
	{
		for(int j=0;j<4;j++)
		{
			cin >>score[i][j];
			T[i]+=score[i][j];
		}
	}
	if(T[1]>=T[2])
	{
		cout<<T[1];
	}
	else 
	{
		cout<<T[2];
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <list>
#include <map>
#include <string>
#include <functional>
#include <math.h>
#include <utility>
using namespace System;
using namespace std;
int main()
{
	int a=0,b=0,t;
	for(int i=0;i<4;i++){cin>>t;a+=t;}
	for(int i=0;i<4;i++){cin>>t;b+=t;}
	cout<<max(a,b)<<endl;
}

C++: #include <iostream>
using namespace std;
int main(void){
    // Your code here!
    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 sa=0, sb=0;
  int n;
  for( int i=0;i<4;i++ ){
    cin >> n;
    sa+=n;
  }
  for( int i=0;i<4;i++ ){
    cin >> n;
    sb+=n;
  }
  cout << (sa>sb?sa:sb) << endl;

}

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;


	cin >>a[0]>>a[1]>>a[2]>>a[3];
	cin >>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;}
	
	cout<<high<<\n;

	return 0;
}

C++: #include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <complex>
#include <ctime>
#include <cstdlib>

using namespace std;

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

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

const int INF = 1 << 30;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int month[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

bool leap(int y)
{
	return ((y%4==0&&y%100!=0)||y%400==0);
}

#define debug(a, b, c) for(int i = 0; i < b; i++){for(int j = 0; j < c; j++){printf("%3d", a[i][j]);}puts("");}puts("-----------------------------------------");

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

	while(cin >> wk)
	{
		a += wk;

		for(int i = 0; i < 4; i++)
		{
			cin >> wk;
			a += wk;
		}
		for(int j = 0; j < 4; j++)
		{
			cin >> wk;
			b += wk;
		}
		if(a == b)
			printf("S");
		else
			printf("%d", (a > b)? a: b);
                        wk = 0
	}
}

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

C++: #include<iostream>
using namespace std;
int main(){
	int a[30],i,s,c,temp;
	for(i=0;i<30;i++){
		a[i]=i+1;
	}
	for(i=0;i<28;i++){
		cin>>c;
		a[c-1]=0;
	}
	for(i=0;i<30;i++){
		for(s=29;s>i;s--){
			if(a[i]<a[s]){
				temp=a[i];
				a[i]=a[s];
				a[s]=temp;
			}
		}
	}
	for(i=1;i>=0;i--){
		cout<<a[i]<<endl;
	}
	return 0;
}

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

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

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

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

int main(){
	int a, b, c, d;
	int e, f, g, h;
	std::cin >> a >> b >> c >> d;
	std::cin >> e >> f >> g >> h;
	std::cout << std::max(a + b + c + d, e + f + g + h) << std::endl;
	return 0;
}

C++: #include<iostream>

using namespace std;

int main(){
	
	int a, b, c, d, e, f, g, h;
	cin >> a >> b >> c >> d >> e >> f>> g >> h;
	int answer;

	if ( a + b + c + d >= e + f + g + h ){
		answer = a + b + c + d;
	}

	if ( e + f + g + h > a + b + c + d ){
		answer = e + f + g + h;
	}

	cout << answer << endl;

	

	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{
		printf("%d\n",t);
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
	int a=0,b=0,tmp;
	for(int i=0;i<4;i++){
		cin>>tmp;
		a+=tmp;
	}
	for(int i=0;i<4;i++){
		cin>>tmp;
		b+=tmp;
	}
	cout<<max(a,b)<<endl;
}

C++: #include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#include<map>
#include<stack>
#include<queue>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int main(){
    int a = 0, b = 0;
    rep(i,8){
        int inp;
        cin >> inp;
        if(i < 4){
            a += inp;
        }else{
            b += inp;
        }
    }
    cout << max(a,b) << endl;
}

C++: #include <iostream>
#include <stdio.h>
#include <string.h>
#include <functional>
#include <algorithm>
#include <string>
#include <cmath>
#include <vector>
#include <valarray>
#include <algorithm>
#include <time.h>
#include <cstdlib>
#include <iomanip>
#include <stdlib.h>

using namespace std;

int main (void)
{
	int a[4],b[4],A,B;
	
	for (int i = 0; i < 4; i++)
	{
		cin >> a[i];
		A += a[i];
	}
	
	for (int i = 0; i < 4; i++)
	{
		cin >> b[i];
		B += b[i];
	}
	
	if (A <= B)
	{
		cout << B << endl;
	}
	else if (A > B)
	{
		cout << A << endl;
	}
}