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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a,b,c,d,e,f,g,h;
    cin >> a >> b >> c >> d;
    cin >> e >> f >> g >> h;
    cout << max((a+b+c+d),(e+f+g+h)) << endl;

    return 0;
}

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

int main(){

 int a,aa,aaa,aaaa,b,bb,bbb,bbbb,s,t;
 cin>>a>>aa>>aaa>>aaaa>>b>>bb>>bbb>>bbbb;

 s=a+aa+aaa+aaaa;
 t=b+bb+bbb+bbbb;
 
 if(s>=t)
  cout<<s<<'\n';
 else
  cout<<t<<'\n';

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 a1,b1,c1,d1,a2,b2,c2,d2,T1,T2,T;
cin >> a1 >> b1 >> c1 >> d1;
cin >> a2 >> b2 >> c2 >> d2;
if(a1>100){
        cout << "エラー" << endl;
        return 0;
}
if(b1>100){
        cout << "エラー" << endl;
        return 0;
}
if(c1>100){
        cout << "エラー" << endl;
        return 0;
}
if(d1>100){
        cout << "エラー" << endl;
        return 0;
}
if(a2>100){
        cout << "エラー" << endl;
        return 0;
}
if(b2>100){
        cout << "エラー" << endl;
        return 0;
}
if(c2>100){
        cout << "エラー" << endl;
        return 0;
}
if(d2>100){
        cout << "エラー" << endl;
        return 0;
}

T1=a1+b1+c1+d1;
//cout << T1 << endl;
T2=a2+b2+c2+d2;
//cout << T2 << endl;
if(T1>T2){
        T=T1;
	//cout << "T1" << endl;
}
if(T2>T1){
        T=T2;
	//cout << "T2" << endl;
}
if(T1==T2){
        T=T1=T2;
	cout << "T1=T2" << endl;
}
cout << T << endl;
return 0;
}

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

using namespace std;

main(){
	int a,b,c,d,A;
	cin >> a >> b >> c >> d;
	A=a+b+c+d;
	int e,f,g,h,B;
	cin >> e >> f >> g >> h;
	B=e+f+g+h;
	if(A > B){
		printf("%d\n",A);
	}
		else if(A < B){
			printf("%d\n",B);
		}
		else{
			printf("%d\n",A);
		}
}

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

#define NUM 1000

int main(){
  int s[NUM];
  int t[NUM];
  int sums = 0;
  int sumt = 0;
  int i;

  for (i = 0; i < 4; i++){
    cin >> s[i];
    sums += s[i];
  }

  for (i = 0; i < 4; i++){
    cin >> t[i];
    sumt += t[i];
  }

  if (sums > sumt){
    cout << sums;
  }
  else {
    cout << sumt;
  }

return 0;

}

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

using namespace std;

int main() {
	int S = 0, T = 0, a;
	for (int i = 0; i < 4; i++)
	{
		scanf_s("%d", &a); 
		S += a;
	}
	for (int i = 0; i < 4; i++)
	{
		scanf_s("%d", &a);
		T += a;
	}
	printf_s("%d\n", max(S, T));
	return 0;
}

C++: #include<stdio.h>
int main(){
	int a,b,c,d,e,f,g,h,s,t;
	scanf("%d %d %d %d",&a,&b,&c,&d);
	scanf("%d %d %d %d",&e,&f,&g,&h);
	 s = a+b+c+d;
	 t = e+f+g+h;
	 if(s>t) printf("%d",s);
	 else if(s<t) printf("%d",t);
	 else if(s==t) printf("%d",s);
	 return 0;
}

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

int main() {
    int a[4],b[4];
    for(int i=0;i<4;i++) scanf("%d",&a[i]);
    for(int i=0;i<4;i++) scanf("%d",&b[i]);
    
    int as=std::accumulate(a,a+4, 0), bs=std::accumulate(b,b+4, 0);
    as < bs ? std::cout << as : std::cout << bs;
    
    return 0;
}

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

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 a[4];
	int b[4];
	int i=0;
	int s=0;
	int t=0;
	
	for(i=0;i<4;i++){
		cin>>a[i];
		s=s+a[i];
	}
	
	for(i=0;i<4;i++){  
		cin>>b[i];
		t=t+b[i];
	}
	
	if(s<t){
		cout<<t;
	}else{
		cout<<s;
	}
}

C++: #include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstdlib>
using namespace std;
int main(){
	int a[2] = {0};
	for(int i = 0; i < 2; i++){
		for(int j = 0; j < 4; j++){
			int b;
			scanf("%d",&b);
			a[i] += b;
		}
	}
	printf("%d\n",max(a[0],a[1]));
	return 0;
}

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

int main () {
	int a1,a2,a3,a4,b1,b2,b3,b4;
	int Atotal,Btotal;
	cin>>a1>>a2>>a3>>a4>>b1>>b2>>b3>>b4;	
	Atotal=a1+a2+a3+a4;
	Btotal=b1+b2+b3+b4;
	if(Atotal>Btotal){
		cout<< Atotal <<'\n';
	}else{if(Atotal<Btotal){
		cout<< Btotal <<'\n';
	}else{
		cout<< Atotal <<'\n';
	}
}
	return 0;
}

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

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

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

C++: #include <iostream>
#include <sstream>
#include <vector>
#include <string>
#include <fstream>
#include <algorithm>
#include <math.h>
#include <map>
using namespace std;

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

bool has_key_using_count(map<char, char> &m, char n){
    if (m.count(n) == 0){
        return false;
    }
    else{
        return true;
    }
}

int main()
{
	//ifstream cin("sample.txt");

	int n = 4, sumA = 0, sumB = 0, t = 0, ans = 0;
	
	rep(i, n) {
		cin >> t;
		sumA += t;
	}
	rep(i, n) {
		cin >> t;
		sumB += t;
	}

	ans = (sumA >= sumB ? sumA : sumB);
	//cout << ans << endl;
	std::cout << ans << endl;

	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

#define for_(i,a,b) for(int i=a;i<b;++i)

int main() {
	int A = 0, B = 0, a;
	for_(i,0,4) scanf("%d", &a), A += a;
	for_(i,0,4) scanf("%d", &a), B += a;
	cout << max(A, B) << 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
}

}

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

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