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,b,c;
    a=b=0;
    for(int i=0;i<4;i++){
        cin>>c;
        a+=c;
    }
    for(int i=0;i<4;i++){
        cin>>c;
        b+=c;
    }
    c=max(a,b);
    cout<<c<<endl;
    return 0;
}

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>
#include<algorithm>
using namespace std;
int main() {
	int a, b, c, d, ans;
	cin >> a >> b >> c >> d;
	ans = a + b + c + d;
	cin >> a >> b >> c >> d;
	cout << max(ans, a + b + c + d) << endl;
}

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

int main() {
	int A[4];
	int B[4];
	cin >> A[0] >> A[1] >> A[2] >> A[3];
	cin >> B[0] >> B[1] >>B[2] >> B[3];
	int a = A[0] + A[1] + A[2] + A[3];
	int b = B[0] + B[1] + B[2] + B[3];
	if (a>=b){
		cout << a << endl;
	}
	else
	{
		cout << b << endl;
	}
	char c;
	cin >> c;
}

C++: #include<iostream>
int main() {
  int a[4],b[4];
  std::cin>>a[0]>>a[1]>>a[2]>>a[3];
  std::cin>>b[0]>>b[1]>>b[2]>>b[3];
  int i,j;
  if((i=a[0]+a[1]+a[2]+a[3]) >= (j=b[0]+b[1]+b[2]+b[3])) {
    std::cout<<i;
  }else{
    std::cout<<j;
  }
}

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 <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;
int main(){
	int a[4],b[4],res;
	scanf("%d%d%d%d",a,a+1,a+2,a+3);
	scanf("%d%d%d%d",b,b+1,b+2,b+3);
	res = max(*a+a[1]+a[2]+a[3],*b+b[1]+b[2]+b[3]);
	printf("%d\n",res);
}

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

int main () {
  int A[3], B[3], a = 0, b = 0;
  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 << a << endl;
  else cout << b << endl;
  return 0;
}

C++: #include<iostream>

using namespace std;

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

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<cctype>
using namespace std;
string str2;
int main(){
	int x[8],i,ans1=0,ans2=0;
	for(i=0;i<8;i++){
		cin>>x[i];
	}
	for(i=0;i<8;i++){
		if(i==0||i==1||i==2||i==3){
			ans1+=x[i];
		}else{
			ans2+=x[i];
		}
	}
	if(ans1<ans2){
		cout<<ans2<<endl;
	}else{
		cout<<ans1<<endl;
	}
	return 0;

}

C++: #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <utility>
using namespace std;

int main() {
	int A,B,S=0,T=0;
	for(int i=0;i<4;i++) {
		scanf("%d",&A);
		S+=A;
	}
	for(int i=0;i<4;i++) {
		scanf("%d",&B);
		T+=B;
	}
	printf("%d\n",max(S,T));
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int A[10],a,b;
  for(int i=0;i<=8;i++){
    cin>>A[i];
  }
  a=A[0]+A[1]+A[2]+A[3];
  b=A[4]+A[5]+A[6]+A[7];
  if(a>=b)cout<<a<<endl;
  else cout<<b<<endl;

 return 0;
}

C++: #include <cstdio>
main(){
	int a[4],ar[3],n=2;
	while(n--){
	scanf("%d%d%d%d",a,a+1,a+2,a+3);
	ar[n]=*a+a[1]+a[2]+a[3];
	}
	printf("%d\n",ar[1]>ar[2]?ar[1]:ar[2]);
}

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

int main(){
int a[2][4];
for(int i=0;i<2;i++)for(int j=0;j<4;j++)
scanf("%d",&a[i][j]);

for(int i=1;i<4;i++){
a[0][0]+=a[0][i];
a[1][0]+=a[1][i];
}

printf("%d\n",max(a[0][0],a[1][0]));
}

C++: #include <iostream>
using namespace std;
int main(){
  int a1,a2,a3,a4;
  int b1,b2,b3,b4;
  cin >> a1 >> a2 >> a3 >> a4 >> b1 >> b2 >> b3 >> b4;

  int suma = a1 + a2 + a3 + a4;
  int sumb = b1 + b2 + b3 + b4;

  if (suma >= sumb)
     cout << suma << endl;
  else 
     cout << sumb << 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<stdio.h>
int main(void)
{
	int a,b,c,d,e,f,g,h,x,y;
	scanf("%d %d %d %d %d %d %d %d",&a,&b,&c,&d,&e,&f,&g,&h);
	x=a+b+c+d;
	y=e+f+g+h;
	if(x>y){
		printf("%d\n",x);
	}
	else if(x=y){
		printf("%d\n",x=y);
	}
	else if(x<y){
		printf("%d\n",y);
	}
	return 0;
}

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

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; 
 int t;
 s=a+b+c+d;
 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<iostream>
#include<cstdio>
using namespace std;
#define int long long
signed main(){
	int a1,b1,c1,d1;
	scanf("%lld %lld %lld %lld",&a1, &b1, &c1, &d1);
	int a2,b2,c2,d2;
	scanf("%lld %lld %lld %lld",&a2, &b2, &c2, &d2);
	int ans1 = a1 + b1 + c1 + d1;
	int ans2 = a2 + b2 + c2 + d2;
	if (ans1 > ans2) cout << ans1 << endl;
	else cout << ans2 << endl;
	return 0;
}

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

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

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

int main(){
  int sum[2] = {0};

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

  cout << max(sum[0], sum[1]) << endl;
}

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

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

int main(){
  int a,b,c,d,e,f,g,h,i,j;
  cin>>a>>b>>c>>d;
  cin>>e>>f>>g>>h;
  i=a+b+c+d;
  j=e+f+g+h;
  if(i<j)cout<<j<<endl;
  if(i>j)cout<<i<<endl;
  if(i==j)cout<<i<<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){
		pritnf("%d=%d\n",s,t);
	}
	else{
		printf("d\n",y);
	}
	return 0;
}