Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"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 main() {
	scanner.Split(bufio.ScanWords)
	points := make([]int, 6)
	for i := 0; i < 6; i++ {
		points[i] = nextInt()
	}
	// fmt.Println(points)
	sort.Slice(points[:4], func(i, j int) bool { return points[i] > points[j] })
	// fmt.Println(points)
	points2 := points[4:]
	sort.Slice(points2, func(i, j int) bool { return points2[i] > points2[j] })
	// fmt.Println(points)

	fmt.Println(points[0] + points[1] + points[2] + points2[0])
}

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

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

C++: #include <bits/stdc++.h>
#define ii pair <int , int>
#define is pair <int, string>
#define ic pair <int, char>
#define ll long long
#define mx 100000
#define sf scanf
#define sf(n) scanf("%d",&n)
#define pf printf
using namespace std;
vector <int> v;

/*int intConvert(string s){
    int n;
    stringstream geek(s);
    geek >> n;
    return n;
}*/

/*string strConvert(int n){
    string s;
    stringstream ss;
    ss << n;
    s=ss.str();
    return s;
}*/


int main(){
    int n=4;
    while(n--){
        int a;
        sf(a);
        v.push_back(a);
    }
    int a,b;
    sf(a),sf(b);
    int Max=max(a,b);

    sort(v.begin(),v.end());
    int sum=0;
    for(int i=3; i>=1; i--){
        sum+=v[i];
    }
    pf("%d\n",(sum+Max));

    return 0;
}

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

int main() {
	int a[4],b[2],c=0,d=0;
	for(int i=0;i<4;i++){
		cin>>a[i];
	}
	for(int i=0;i<2;i++){
		cin>>b[i];
	}
	sort(a,a+4);
	reverse(a,a+4);
	if(b[0]<b[1]){
		b[0]=b[1];
	}
	for(int i=0;i<3;i++){
		c=c+a[i];
	}
	d=b[0];
	d=d+c;
	cout<<d<<endl;
	// your code goes here
	return 0;
}

C++: #include<iostream>
using namespace std;
int i, sumrika=0, sumsha=0, t, u, cnt=0;
int minrika=110, minsha=110;
int rika[5], dha[3];
int main(){
for(i=1; i<=4; i++){
   cin>>rika[i]; sumrika+=rika[i];
   if(rika[i]<minrika){minrika=rika[i];}
}
for(i=1; i<=2; i++){
    cin>>sha[i]; sumsha+=sha[i];
    if(sha[i]<minsha){minsha=sha[i];}
}
int disp = (sumrika-minrika)+(sumsha-minsha);
cout << disp << endl;
}

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


int main(){
  int a[4],b[2];
  for(int i=0;i<4;i++) scanf("%d",a+i);
  for(int i=0;i<2;i++) scanf("%d",b+i);
  sort(a,a+4);
  sort(b,b+2);
  int ans = 0;
  for(int i=3;i>0;i--) ans+=a[i];
  ans+=b[1];
  printf("%d\n",ans);
  return 0;
}

C++: #include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<algorithm>
#include<functional>
#include<utility>
#include<bitset>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<cstdio>

using namespace std;

#define REP(i,n) for(int i=0;i<int(n);i++)
#define foreach(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
typedef long long ll;
typedef pair<int,int> P;

int main(void){
	          int i;

	          int mn=1e9,mx=0,s=0;
	          for(i=1;i<=6;i++){
	        	  int x;
	        	  cin >> x;
	        	  if(i<=4){
	        		  s+=x;
	        		  mn=min(mn,x);
	        	  }else{
	        		  mx=max(mx,x);
	        	  }
	          }

	          cout << s-mn+mx << endl;

	          return 0;
}

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

C++: //============================================================================
// Name        : JOI.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;
int A,B,C,D,E,F;
int main() {
	cin>>A>>B>>C>>D>>E>>F;

	int S,T;
	int M=A;
	if(B<M)M=B;
	if(C<M)M=C;
	if(D<M)M=D;
	S=A+B+C+D-M;
	int N=E;
	if(F<N)N=F;
	T=E+F-N;
	cout<<S+T<<endl;


	return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<string>
#include <algorithm>
#include<cstring>
#include <math.h>
#include <iomanip>
using namespace std;

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

C++: #include <iostream>
using namespace std;
int main(void)
{
	int a,b,c[100]={0},d,e=0,f=0,g,h,i;
	for (a=0;a<4;a++)
	{
		cin>>b;
		c[b]=1;
	}
	for (a=99;a>0;a--)
	{
		if (c[a]==1&&e!=3)
		{
			f=f+a;
			e++;
		}
	}
	cin>>d>>e;
	if (d>=e)
	{
		g=d+f;
	}
	else if (d<=e)
	{
		g=e+f;
	}
	cout<<g<<endl;
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int a[6],i,w,x,j;
	for(i=0;i<6;i++){
		scanf("%d",&a[i]);
	}
	for(i=0;i<3;i++){
		for(j=i+1;j<4;j++){
			if(a[i]<a[j]){
				w=a[i];
				a[i]=a[j];
				a[j]=w;
			}
		}
		for(j=0;j<4;j++){
			printf("%d ",a[j]);
		}
		printf("\n");
	}
	if(a[4]>a[5]){
		x=a[0]+a[1]+a[2]+a[4];
	}
	else{
		x=a[0]+a[1]+a[2]+a[5];
	}
	printf("%d\n",x);
	return 0;
}

C++: #include <iostream>

using namespace std;

int main ()
{
	int a[100],b[100],a1,a2,a3,b1;

	a1 = 0;
	a2 = 0;
	a3 = 0;
	b1 = 0;

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

	for (int i = 0; i < 4; i++)
	{
		if (a[i] >= a1)
		{
			a3 = 0;
			a3 = a2;
			a2 = 0;
			a2 = a1;
			a1 = 0;
			a1 = a[i];
		}
		else if (a[i] >= a2)
		{
			a3 = 0;
			a3 = a2;
			a2 = 0;
			a2 = a[i];
		}
		else if (a[i] >= a3)
		{
			a3 = 0;
			a3 = a[i];
		}
	}
	for (int j = 0; j < 2; j++)
	{
		if (b1 < b[j])
		{
			b1 = 0;
			b1 = b[j];
		}
	}

	cout << a1 + a2 + a3 + b1 << endl;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main(){
    vector<int> science(4);
    vector<int> human(2);
    rep(i, 4){
        cin>>science.at(i);
    }
    rep(i, 2){
        cin>>human.at(i);
    }
    sort(science.begin(), science.end());
    sort(human.begin(), human.end());
    int ans=0;
    rep(i, 4){
        ans+=science.at(i);
    }
    rep(i, 2){
        ans+=human.at(i);
    }
    ans=ans-human.at(0)-science.at(0);
    cout<<ans<<endl;
}

C++: #include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
const ll INF=1e18;
const ll MOD=1e9+7;
const double pi=acos(-1);
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

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