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 <stdio.h>
using namespace std;

int main() {
	int test1 = 0,test2 = 0,data,i;
	for(i = 0;i < 4;i++){
		scanf("%d",&data);
		test1 += data;
	}
	for(i = 0;i < 4;i++){
		scanf("%d",&data);
		test2 += data;
	}
	if(test1 >= test2){
		printf("%d\n",test1);
	}
	else{
		printf("%d\n",test2);
	}
}

C++: #include<iostream>
using namespace std;
 
int main(){
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\n";
else cout<<"T\n";
return 0;
}

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

int main(void)
{
    int score;
    int A_sum = 0, B_sum = 0;
    
    for (int i = 0; i < 8; i++){
        scanf(" %d", &score);
        if (i < 4){
            A_sum += score;
        }
        else {
            B_sum += score;
        }
    }
    
    printf("%d\n", (B_sum <= A_sum) ? A_sum : B_sum);
    
    return (0);
}

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

int main(){
	int sum1 = 0, sum2 = 0, a1, a2;	
	for(int i = 0; i < 4; i++){
		cin >> a1;
		sum1 += a1;
	}
	for(int i = 0; i < 4; i++){
		cin >> a2;
		sum2 += a2;
	}

	if(a1 >= a2){
		cout << sum1 << endl;
	}else{
		cout << sum2 << endl;
	}

}

C++: #include <stdio.h>
using namespace std;

int main(){
  int i0,i1,i2,i3,i4,i5;

  scanf("%d%d%d%d",&i0,&i1,&i2,&i3);  
  i4 = i0 + i1 + i2 + i3;

  scanf("%d%d%d%d",&i0,&i1,&i2,&i3);
  i5 = i0 + i1 + i2 + i3;

  if(i4 == i5) printf("%d",i4);
  else{  
    if(i4 < i5) printf("%d",i5);
    else printf("%d",i4);
  } 
}

C++: #include <iostream>
#include <math.h>
using namespace std;
int main() {
  int sn;
  int score1,score2;
  for(int n = 0;n<4;n++){
    cin >> sn;
    score1 += sn;
   }
  for(int n = 0;n<4;n++){
    cin >> sn;
    score2 += sn;
   }
   if(score1 > score2){
     cout << score1 << endl;
   }else{
     cout << score2 << endl;
   }
   return 0;
}

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

C++: #include <iostream>

using namespace std;

int main() {
    int temp;
    int sum[2];
    for(int i = 0; i<2; i++) {
        sum[i] = 0;
        for(int j=0; j<4; j++) {
            cin >> temp;
            sum[i] += temp;
        }
    }

    if( sum[0] > sum[1] ) cout << sum[0] << endl;
    else cout << sum[1] << endl;

    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
int aa,ab,ac,ad,ba,bb,bc,bd,sum_a,sum_b;
cin>>aa>ab>>ac>>ad;
cin>>ba>>bb>bc>>bd;
sum_a=aa+ab+ac+ad;
sum_b=ba+bb+bc+bd;
if(sum_a>=sum_b){
cout<<sum_a<<endl;
}else{
cout<<sum_b<<endl;
}
return 0;
}

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

C++: #include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define rer(i,l,n) for(int i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int,int> pii;

int main(){
	int s=0,t=0,a;
	rep(i,0,4){
		cin>>a; s+=a;
	}
	rep(i,0,4){
		cin>>a; t+=a;
	}
	o(max(s,t));
}

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

int main() {
    int sumA = 0, sumB = 0, input;
    for (int i = 0; i < 4; i++) {
        cin >> input;
        sumA += input;
    }
    for (int i = 0; i < 4; i++) {
        cin >> input;
        sumB += input;
    }
    cout << max(sumA, sumB) << endl;
}

C++: #include<bits/stdc++.h>

using namespace std;

int solve(int m){

	int A,B,ma,i,s,e;
	
	cin>>ma>>i>>s>>e;
		
		A=ma+i+s+e;
		
	cin>>ma>>i>>s>>e;
	
		B=ma+i+s+e;
		
	if(A>B){
		return A;
	}	
	else if(A<B){
		return B;
	}
	else {return A;
	}
	return m;
}

int main(){
	int n;
	cin >> n;
	cout << solve(n) << endl;
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef long long ll;
// Welcome to my source code!

int main() {
    ll a, b, c, d, e, f, g, h;
    cin >> a >> b >> c >> d >> e >> f >> g >> h;
    ll as = a + b + c + d, bs = e + f + g + h;
    cout << max(as, bs) << endl;
}

C++: #include <bits/stdc++.h>
 
using namespace std;
 
/*-------------------------------*/
#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--)
#define all(i) (i).begin(),(i).end()
#define pb push_back
#define mp make_pair 
 
typedef long long ll;
typedef pair<int, int> pint;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef vector<long long> llv;
typedef vector<pint> vpint;
/*-------------------------------*/
 
int main(void)
{
  int a = 0, b = 0, c;
  REP(i, 4){
    cin >> c;
    a += c;
  }
  REP(i, 4){
    cin >> c;
    b += c;
  }
  cout << max(a, b) << endl;
  
  return (0);
}

C++: #include <iostream>
#include <stdio.h>
#include <string.h>
#include <functional>
#include <algorithm>
#include <string>
#include <vector>
#include <algorithm>
#include <time.h>

using namespace std;

int main (void)
{
	int a[3],b[3],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;
	}
}

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

int main(int argc, char *argv[])
{
  int a,b,c,d;
  int n = 2;
  int Max = 0;
  while(n--){
  scanf("%d %d %d %d",&a,&b,&c,&d);
  getchar();
   Max =max(Max,a+b+c+d);
  }
  cout <<Max<<endl;
  return 0;
}

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

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

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

using namespace std;

int main() {
    int a[8];
    for (int i=0; i<8; ++i) cin >> a[i];
    cout << max(accumulate(a, a+4, 0), accumulate(a+4, a+8, 0)) << endl;
    return 0;
}

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

int main(){
	int s, sum[2] = { 0 };
	for (int j = 0; j < 2; j++) {
		for (int i = 0; i < 4; i++) {
			scanf("%d", &s);
			sum[j] += s;
		}
	}
	printf("%d\n", sum[0] > sum[1] ? sum[0] : sum[1]);


	return 0;
}

C++: #include <iostream>

using namespace std;

int main(){
	int a;
	int b;
	int c;
	int d;
	int e;
	int f;
	int g;
	int h;
	cin>>a>>b>>c>>d;
	cin>>e>>f>>g>>h;
	int A=a+b+c+d;
	int B=e+f+g+h;
	if(A>B)
	{
	    cout<<A<<endl;
	}
	else if(B>A)
	{
        cout<<B<<endl;	
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int x,y,z,u;
    int a,b,c,d;
    cin >> x >> y >>z >> u;
    cin >>a >> b >> c >>d;
    int S;
    int T;
    S=x+y+z+u;
    T=a+b+c+d;
    if(S==T||S>T)
        cout << S << endl;
    else
        cout << T << endl;
}