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() {
  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<stdio.h>
int main(void)
{
	int a,b,i,j,s,ss;
	for(i=0;i<4;i++){
		scanf("%d",&a);
		s+=a;
	}
	for(j=0;j<4;j++){
		scanf("%d",&b);
		ss+=b;
	}
	if(s>ss){
		printf("%d\n",s);
	}
	if(s==ss){
		printf("%d\n",s);
	}
	else{
		printf("%d\n",ss);
	}
	return 0;
}

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

int main()
{
int p1=0,p2=0;
for(int i=0;i<4;i++){
int t;
cin>>t;
p1+=t;
}
for(int i=0;i<4;i++){
int t;
cin>>t;
p2+=t;
}
cout<<max(p1,p2)<<endl;
}

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

int main()
{
 int a1,b1,c1,d1,a2,b2,c2,d2,x,y;
 cin>>a1>>b1>>c1>>d1;
 cin>>a2>>b2>>c2>>d2;
 x=a1+b1+c1+d1;
 y=a2+b2+c2+d2;

 if(x>=y)cout<<x<<"\n";
 else cout<<y<<"\n";

 return 0;
}

C++: //https://onlinejudge.u-aizu.ac.jp/challenges/sources/JOI/Prelim/0510?year=2007

#include <bits/stdc++.h>

using namespace std;

int main() {
    int sumA = 0;
    for (int i = 0; i < 4; ++i) {
        int a;
        cin >> a;
        sumA += a;
    }

    int sumB = 0;
    for (int i = 0; i < 4; ++i) {
        int b;
        cin >> b;
        sumB += b;
    }

    cout << max(sumA, sumB) << endl;
    return 0;
}

/*
 *
 */

C++: #include <stdio.h>
int a,b,c;main(){for(;scanf("%d",&a);b+=a);for(;scanf("%d",&a);c+=a);printf("%d",b>=c?b:c);}

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

using namespace std;

int sum(int x[], int xNum) {
	int result = 0;
	for (int i = 0; i < xNum; i++) {
		result += x[i];
	}
	return result;
}

int main(void){
    int aSum, bSum;
	int a[4], b[4];

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

	aSum = sum(a, sizeof a / sizeof a[0]);
	bSum = sum(b, sizeof b / sizeof b[0]);

	cout << ((aSum >= bSum) ? aSum : bSum);

    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=(a+b+c+d); 
 int 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 "bits/stdc++.h"

using namespace std;

const char en = '\n';
using  ll =          long long;
using ull = unsigned long long;

#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,s,g) for(int i=s;i<g;i++)

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

	int a=0,b=0,buf;

	REP(i,4) cin>>buf,a+=buf;
	REP(i,4) cin>>buf,b+=buf;

	cout<<max(a,b)<<en;
	return 0;
}

C++: #include <iostream>
int main(){int a,b,c,d,e,f,g,h,i,j;std::cin>>a>>b>>c>>d>>e>>f>>g>>h;i=a+b+c+d;j=e+f+g+h;std::cout<<((i>j)?i:j)<<std::endl;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 <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

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

C++: #include<bits/stdc++.h>
#define enld '\n'
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast")
constexpr ll INF = 1e18;
constexpr int inf = 1e9;
constexpr ll mod = 1000000007;
constexpr ll mod2 = 998244353;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[6] = {1, 0, -1, 0,1,1};
const int dy[6] = {0, 1, 0, -1,1,-1};
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
// ---------------------------------------------------------------------------

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int A=0,B=0;
    for(int i=0; i<4; i++){
        int a;
        cin >> a;
        A += a;
    }
    for(int i=0; i<4; i++){
        int a;
        cin >> a;
        B += a;
    }
    cout << max(A,B) << enld;
    return 0;
}

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

int main() {
	int a[4], b[4], S=0, T=0;
	for(int i=0; i<4; i++){
		cin >> a[i];
		S += a[i];
	}
	for(int j=0; j<4; j++){
		cin >> b[j];
		T += b[j];
	}
	if(S>=T) cout << S << endl;
	else cout << T << endl;
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int a,b,c,d,e,f,g,h,x,y;
    cin >>a>>b>>c>>d;
    cin >>e>>f>>g>>h;
    x=a+b+c+d;
    y=e+f+g+h;
    
    if (x<y){
        cout << y;
    }
    else {
        cout <<x;
    }
    cout << endl;
}

C++: #include <iostream>

using namespace std;

int main()
{
	int score_a[4];
	int score_b[4];
	int sum_a, sum_b;
	
	cin >> score_a[0] >> score_a[1] >> score_a[2] >> score_a[3];
	cin >> score_b[0] >> score_b[1] >> score_b[2] >> score_b[3];
	sum_a = score_a[0] + score_a[1] + score_a[2] + score_a[3];
	sum_b = score_b[0] + score_b[1] + score_b[2] + score_b[3];
	
	if (sum_a > sum_b) cout << sum_a << "\n";
	else cout << sum_b << "\n";
	
	return 0;
}

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

C++: import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		int ans = 0;
		for(int i=0;i<2;i++){
			int sum=0;
			for(int j=0;j<4;j++){
				Scanner stdIn = new Scanner(System.in);
				int p = stdIn.nextInt();
				sum += p;
			}
			ans = Math.max(sum, ans);
		}
		System.out.println(ans);
	}

}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main(){
  int s,t,a,b,c,d,max_;
  cin >>a>>b>>c>>d;
  s=a+b+c+d;
  cin >>a>>b>>c>>d;
  t=a+b+c+d;
  max_=max(s,t);
  cout<<max_<<endl;
  return 0;
}

C++: #include<iostream>
using namespace std;
int i, p, sumA=0, sumB=0;
int main(){
    for (i=1; i<=4; i++) {
        cin >> p;
        sumA += p;
}
for (i=1; i<=4; i++) {
cin >> p; sumB += p;
}
cout << max(sumA, sumB) << endl;
return 0;
}

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

int main(){
	int tmp, suma = 0, sumb = 0;
	for (int i = 0; i < 4; i++) {
		cin >> tmp;
		suma += tmp;
	}
	for (int i = 0; i < 4; i++) {
		cin >> tmp;
		sumb += tmp;
	}
	cout << max(suma, sumb) << endl;
	return 0;
}