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++: /**********************************************

1.score.cpp
2.テァツつュテァツ板ーテゥツォツ佚ィツシツ?
3.sumita.takaki@gmail.com

last updated: 2013-07-10@11:54

 **********************************************/
#include<iostream>
#include<algorithm>
#include<sstream>
#include<vector>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<string>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cctype>
using namespace std;

int main (void){

        while(1){
                
                int a=0,total1=0;
                int b=0,total2=0;
                
                for(int i=0; i<4; i++){
                        
                        cin >> a;                
                        total1 = total1 + a;
                }
                if(a == NULL)break;
                
                for(int i=0; i<4; i++){
                        
                        cin >> b;
                        total2 = total2 +b;                
                }
                
                if(total1 > total2){
                        cout << total1 <<endl;
                }else{
                        cout << total2 << endl;
                }
                
        }



}

C++: #include <stdio.h>
int a,b,c,i;main(){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>
using std::cout;
using std::cin;

int main(){
	int tmp,S=0,T=0;
	for(int i9; i<4; i++){
		cin >> tmp;
		S+=tmp;
	}
	for(int i9; i<4; i++){
		cin >> tmp;
		T+=tmp;
	}
	if(S>T)
		cout << S << endl;
	else
		cout << T << endl;
	return 0;
}

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(s<ss){
		printf("%d\n",ss);
	}
	else{
		printf("%d\n",s);
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main(){
	int b, s, t;
	s = 0;
	t = 0;

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

	if (s >= t){
		cout << s << endl;
	}
	else {
		cout << t << endl;
	}
		
}

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

int main(){
	int v[2]={};
	for(int i=0; i<2; i++){
		for(int j=0; j<4; j++){
			int n;
			cin >> n;
			v[i] += n;
		}
	}
	cout << max(v[0], v[1]) << endl;
}

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

int main ()
{
int a=4,b,c,d;
while(a--)
{
cin>>c;
b+=c;
}a=4;
while(a--)
{
cin>>c;
d+=c;
}
if(b>d)cout<<b<<endl;
else cout<<d<<endl;
return 0;
}

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

int a, b, c, d, e, f, g, h, i, j;

int main()
{
    for(int i=0; i < 2; ++i) {
        cin >> c >> d >> e >> f >> g >> h >> i >> j;
        a += c+d+e+f, b += g+h+i+j;
    }
    printf("%d\n", (a > b) ? a : b);
    return 0;
}

C++: #include<bits/stdc++.h>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
typedef long long ll;

int main(){
	int a=0,b=0,c;
	for(int i=0;i<8;i++){ scanf("%d",&c); if(i<4) a+=c; else b+=c;}
	printf("%d\n",max(a,b)); 
}

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

int main(){
	int A = 0;
	int B = 0;
	int buf;
	for(int a = 0; a < 4; a++){
		scanf("%d", &buf);
		A += buf;
	}
	for(int a = 0; a < 4; a++){
		scanf("%d", &buf);
		B += buf;
	}
	printf("%d", max(A, B));
	return 0;
}

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

C++: #include <iostream>
using namespace std;
int main(void){
    int i, m, c, e, S;
    
    cin >> i >> m >> c >> e;
    S = i + m + c + e;
    
    int I, M, C, E, T;
    
    cin >> I >> M >> C >> E;
    T = I + M + C + E;
    
    if (S >= T){
        cout << S;
    }else{
        cout << T;
    }
    cout << endl;
    
}

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

C++: #include <stdio.h>
a,b,c,i;main(){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 <queue>
#include <cctype>
#include <stdio.h>
#include <map>

using namespace std;


int main(int argc, char const* argv[])
{
    int a=0;
    int b=0;
    int 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<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);
	}
	if(x<y){
		printf("%d\n",y);
	}
	return 0;
}

C++: #include<iostream>
#include<vector>
using namespace std;
int main(){
    int sum1=0,sum2=0,x;
    for(int i=0;i<4;i++){
        cin >> x;
        sum1 += x;
    }
    for(int i=0;i<4;i++){
        cin >> x;
        sum2 += x;
    }
    if(sum1>sum2)   cout << sum1 << "\n";
    else    cout << sum2 << "\n";
    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<cstdio>
#include<cstdlib>
#include<ctime>
#include<cmath>
#include<cstring>
#include<cctype>
#include<complex>
#include<iostream>
#include<sstream>
#include<algorithm>
#include<functional>
#include<vector>
#include<string>
#include<stack>
#include<queue>
#include<map>
#include<bitset>
using namespace std;
const int dx[] = {1,0,-1,0},dy[] = {0,1,0,-1};
#define INF 1e+8
#define EPS 1e-8
#define rep(i,j) for(int i = 0; i < (j); i++)
#define reps(i,j,k) for(int i = (j); i < (k); i++)

int main(){
	int a,b,c,d;
	int 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>
#include<string>
#include<cstring>
using namespace std;

int main()
{
	int num1,num2,num3,num4,num5,num6,num7,num8,num9,num10;

	cin>>num1>>num2>>num3>>num4>>num5>>num6>>num7>>num8;
	num9=num1+num2+num3+num4;
	num10=num5+num6+num7+num8;
	if(num9>=num10){
		cout<<num9;
	}
	if(num9<num10){
		cout<<num10;
	}
	cout<<"\n";
	return 0;
}

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

#define PI 4*atan(1);

int main(){
  int a, b, asum = 0, bsum = 0;
  for(int i = 0; i < 4; i++){
    cin >> a;
    asum += a;
  }
  for(int i = 0; i < 4; i++){
    cin >> b;
    bsum += b;
  }
  if(asum >= bsum)cout << asum << endl;
  if(asum < bsum)cout << bsum << endl;
}

C++: #include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main() {
  int a[4]={},b[4]={},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];
  }
  cout << max(A,B) << endl;
}