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(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()
{ int a,b,c,d,A,B,C,D;
cin>>a>>b>>c>>d;
cin>>A>>B>>C>>D;
if(a+b+c+d>=A+B+C+D){cout<<a+b+c+d<<"\n";}
else{cout<<A+B+C+D<<"\n";}
 return 0;
}

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

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <list>
#include <map>
#include <string>
#include <functional>
#include <math.h>
#include <utility>
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++: // 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>

int main()
{
  int a,b,as=0,bs=0;
  for(int i=0;i<4;i++){
    std::cin >> a;
    as+=a;
  }
  for(int i=0;i<4;i++){
    std::cin >> b;
    bs+=b;
  }
  if(as>=bs) std::cout << as << std::endl;
  else std::cout << bs << std::endl;
  return 0;
}

C++: #include <stdio.h>

int main(void) {
    int a1, a2, a3, a4, b1, b2, b3, b4, S, T;

    scanf ("%d %d %d %d\n", &a1, &a2, &a3, &a4);    
    scanf ("%d %d %d %d\n", &b1, &b2, &b3, &b4);

    S = a1 + a2 + a3 + a4;
    T = b1 + b2 + b3 + b4;

    if (S > T) {
        printf ("%d\n", S);
    }
    else {
        printf ("%d\n", T);
    }

    return 0;
}

C++: #include <iostream>

using namespace std;

int main(){
	int a,b,c,d,s,t;
	cin>>a>>b>>c>>d;
	s=a+b+c+d;
	cin>>a>>b>>c>>d;
	t=a+b+c+d;
	cout<<max(s,t)<<endl;
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>
 
using namespace std;
 
#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
 
typedef vector<int> vi;
typedef pair<int,int> pii;
 
int main(void) {
  int i;
  int a=0,b=0;
  int n;
  rep(i,4){
    cin>>n;
    a+=n;
  }
  rep(i,4){
    cin>>n;
    b+=n;
  }
  cout<<max(a,b)<<endl;
}

C++: #include <cstdio>
using namespace std;
int main()
{
int a,b,x;
for(int i=0;i<8;i++){scanf("%d",&x); if(i<=3) a+=x; else b+=x;}
printf("&d",max(a,b));
}

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

int main(void){
	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;
	return 0;
}

C++: #include <iostream>
using namaspace 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 (a>b) cout<<a<<endl;
	else cout<<b<<endl;
	return 0;
}

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

int main() {
	vector<int>a(2);
	for (int b = 0; b < 2; b++) {
		for (int c = 0; c < 4; c++) {
			int d;
			cin >> d;
			a[b] += d;
		}
	}
	cout << max(a[0], a[1]) << endl;
}

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

using namespace std;

int main ()
{
	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 - 1 << endl;
	}
	else if (A > B)
	{
		cout << A - 1 << endl;
	}
}

C++: #include<iostream>
 
using namespace std;
 
int main(){
  int a=0;
  int temp;
  for(int i=0;i<4;i++){
    cin >> temp;
    a+=temp;
  }
  //int b=0;
  int ab=a;
  for(int i=0;i<4;i++){
    cin >> temp;
    ab-=temp;
  }
  if(ab<0){
    cout <<(a-ab)<<endl;
  }else{
      cout << a<< endl;
    }
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <utility>
#include <cctype>
#include <numeric>
using namespace std;

#define rep(i,n) for(int (i)=0; (i)<(int)(n); ++(i))
#define foreach(c,i) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)

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

C++: #include<stdio.h>
int main(void)
{
	int n=0,m=0,x=0,w=0,n2=0,m2=0,x2=0,w2=0,s=0,t=0;
	scanf("%d %d %d %d",&n,&m,&x,&w);	
	scanf("%d %d %d %d",&n2,&m2,&x2,&w2);
	s=n+m+x+w;
	t=m2+n2+x2+w2;
	if(s>t||s==t){
		printf("%d\n",s);
	}	
	else{
		printf("%d\n",t);
	}
}

C++: #include <studio.h> int main() { printf("Hello!"); return 0; }

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

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

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

using namespace std;
int main(){
	int a[2];
	int n[2][4];
	
	rep(i,2)rep(j,4)scanf("%d",&n[i][j]);
	
	a[0]=0;
	a[1]=0;
	
	rep(i,2)rep(j,4)a[i]+=n[i][j];
	
	printf("%d\n",max(a[0],a[1]));
	
}

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

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

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

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

int get(){
    int ret=0;
    for(int i=0;i<4;i++){
        int a;cin>>a;
        ret+=a;
    }
    return ret;
}
int main(){
    cout<<max(get(),get())<<endl;
    return 0;
}