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

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

int main(){
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<<"S\n";
else cout<<"T\n";

return 0;
}

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

int main(){

  int a[8];
  for(int i=0;i<8;i++){
    cin >> a[1][i];
  }
  for(int i=0;i=0;i++){
    cin >> a[2][i];
  }
  if((a[0][0]+a[0][1]+a[0][2]+a[0][3]) > (a[1][0]+a[1][1]+a[1][2]+a[1][3])){
    cout << a[0][0]+a[0][1]+a[0][2]+a[0][3] << endl;
  }
  else{
    cout << a[1][0]+a[1][1]+a[1][2]+a[1][3] << endl;
  }

  return 0;
}

C++: #include <iostream>
#define REP(i, a, n) for(int i = a; i < n; i++)
using namespace std;


int S, T, U;

int main(void) {
  S = 0;
  REP(i, 0, 4) {
    cin >> U;
    S += U;
  }

  T = 0;
  REP(i, 0, 4) {
    cin >> U;
    T += U;
  }

  cout << max(S, T) << endl;

  return 0;
}

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

using namespace std;

#define print(a) printf("%d\n", a)

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

#define MAX(a,b) ((a)>(b)?(a):(b))


int main(){
	int s = 0, t = 0, tmp;
	
	REP(i,4){
		cin >> tmp;
		s += tmp;
	}
	
	REP(i,4){
		cin >> tmp;
		t += tmp;
	}
	
	print(MAX(s,t));
	
	return 0;
}

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

int main(){

  int sum1=0,sum2=0;
  int a;
  for(int i=0; i<4; i++){
    cin>>a;
    sum1 += a;
  }
 for(int i=0; i<4; i++){
    cin>>a;
    sum2 += a;
  }

 (sum1>sum2)? cout<<sum1<<endl : cout<<sum2<<endl;

  return 0;
}

C++: #include<iostream>

using namespace std;

int main(){
  int sum1 = 0, sum2 = 0;
  int n;
  for(int i = 0; i< 4; i++){
    cin >> n;
    sum1 += n;
  }
  for(int i = 0; i< 4; i++){
    cin >> n;
    sum2 += n;
  }

  if(sum1 > sum2) cout << sum1<<endl;
  else cout << sum2<<endl;

  return 0;
}

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

int main() {
  cin >> a1 >> a2 >> a3 >> a4 >> b1 >> b2 >> b3 >> b4;
  atot = a1 + a2 + a3 + a4;
  btot = b1 + b2 + b3 + b4;
  if( atot > btot)
    cout << atot << endl;
  else
    cout << btot << endl;
}

C++: #include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <complex>
#include <ctime>
#include <cstdlib>

using namespace std;

inline int to_int(string s) {int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string to_str(T x) {ostringstream sout; sout << x; return sout.str();}

typedef pair<int, int> P;
typedef long long ll;

const int INF = 1 << 30;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int month[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

bool leap(int y)
{
	return ((y%4==0&&y%100!=0)||y%400==0);
}

#define debug(a, b, c) for(int i = 0; i < b; i++){for(int j = 0; j < c; j++){printf("%3d", a[i][j]);}puts("");}puts("-----------------------------------------");

int main()
{
	int a = 0, b = 0, wk;

	while(cin >> wk)
	{
		a += wk;

		for(int i = 0; i < 4; i++)
		{
			cin >> wk;
			a += wk;
		}
		for(int j = 0; j < 4; j++)
		{
			cin >> wk;
			b += wk;
		}
		if(a == b)
			printf("S");
		else
			printf("%d", (a > b)? a: b);
                        wk = 0
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
#define rep(i,n) for (ll i=0;i<(n);++i)
#define rep2(i,a,b) for (ll i=(a);i<(b);++i)
#define debug(x) cout << #x << '=' << x << endl
#define all(v) (v).begin(),(v).end()
const ll MOD=1e9+7;
//const ll MOD=998244353;
const ll INF=1e9;
const ll IINF=1e18;
const double EPS=1e-8;
const double pi=acos(-1);

template<class T> inline bool chmin(T &a,T b){
    if (a>b){a=b; return true;} return false;
}
template<class T> inline bool chmax(T &a,T b){
    if (a<b){a=b; return true;} return false;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a=0,b=0,c;
    rep(i,4) cin >> c,a+=c;
    rep(i,4) cin >> c,b+=c;
    cout << max(a,b) << endl;
}

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<<std::endl;
  }
}

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

using namespace std;

int main(){
	int a[4],b[4],A,B;
	scanf("%d %d %d %d",&a[0],&a[1],&a[2],&a[3]);
	scanf("%d %d %d %d",&b[0],&b[1],&b[2],&b[4]);
	A = a[0] + a[1] + a[2] + a[3];
	B = b[0] + b[1] + b[2] + b[3];
	if(A > B){
		printf("%d\n",A);
	}else{
		printf("%d\n",B);
	}

    return 0;
}

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

int main(
	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 << s << endl;
}
else {
	cout << t << endl;
}

	return 0;
)

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 main(){

	int a = 0, b = 0,i,buf;

	for (i = 0; 4 > i; i++){
		scanf("%d", &buf);
		a += buf;
	}
	for (i = 0; 4 > i; i++){
		scanf("%d", &buf);
		b += buf;
	}
	printf("%d", a > b ? a : b);
return 0;
}

C++: #include <stdio.h>

int main(){
	int a,b,c,d,e,f,g,h,i,j;
	while(1){
		scanf("%d %d %d %d",&a,&b,&c,&d);
		scanf("%d %d %d %d",&e,&f,&g,&h);
		i=a+b+c+d;
		j=e+f+g+h;
		if(i==j){
			printf("%d\n",i);
		}else if(i<j){
			printf("%d\n",j);
		}else if(i>j){
			printf("%d\n",i);
			return 0;
		}
	}
}

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

int main()
{	
	int a[2] = { 0, 0 }, b;

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

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

	return 0;
}