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++: //2015
#include<iostream>
#include<algorithm>
#include<functional>
using namespace std;
int main(void){
	int i,ad[4]={0},e=0,f=0,sum=0;
	for(i=0;i<4;i++){
		cin>>ad[i];
	}
	cin>>e;
	cin>>f;
	sort(ad,ad+4,greater<int>());//降順,昇順＝＝sort(ad,ad+4);
	for(i=0;i<3;i++){
		sum+=ad[i];
	}
	if(e<f){
		sum+=f;
	}
	else{
		sum+=e;
	}
	cout<<sum<<endl;
	return 0;
}

C++: // yo1.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
//

#include <bits/stdc++.h>

using namespace std;

int main()
{
	int a[6], ans = 0;
	for (int i = 0; i < 6; ++i) {
		cin >> a[i];
	}
	sort(a, a + 4);
	sort(a + 4, a + 6);

	for (int i = 1; i < 4; ++i) {
		ans += a[i];
	}
	ans += a[5];
	cout << ans << endl;

    return 0;
}

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 MOD 1000000007
#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 sum=0;
  int a,i;
  int m=INF;
  rep(i,4){
    cin>>a;
    sum+=a;
    m=min(m,a);
  }
  sum-=m;
  m=INF;
  rep(i,2){
    cin>>a;
    sum+=a;
    m=min(m,a);
  }
  sum-=m;
  cout<<sum<<endl;
}

C++: #include<stdio.h>
#include<string.h>
int main(){
	int r=0,a[4],b[2],i,s=100,nf;
	scanf("%d%d%d%d%d%d",&a[0],&a[1],&a[2],&a[3],&b[0],&b[1]);
	for(i=0;i<4;i++){
		if(s>=a[i]){
			s=a[i];
			nf=i;
		}
	}
	for(i=0;i<4;i++){
		if(i!=nf){
			r+=a[i];
		}
	}
	printf("%d\n",r);
	
	if(b[0]>b[1]){
		r+=b[0];
	}else{
		r+=b[1];
	}
	
	printf("%d\n",r);
	return 0;
}

C++: // 2019/12/03 Tazoe

#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
	int A, B, C, D, E, F;
	cin >> A;
	cin >> B;
	cin >> C;
	cin >> D;
	cin >> E;
	cin >> F;

	cout << A+B+C+D+E+F-min(A, min(B, min(C, D)))-min(E, F) << endl;

	return 0;
}

C++: #include<cstdio>
#include<algorithm>
#include<cstring>
#include<functional>
using namespace std;
int main(void)
{
	int a[4],b[2],min=101,min2=101,sum=0,sum2=0,i;
	for(i=0;i<4;i++) {
		scanf("%d",&a[i]);
		sum+=a[i];
		if(min>a[i]) min=a[i];
	}
	for(i=0;i<2;i++) {
		scanf("%d",&b[i]);
		sum2+=b[i];
		if(min2>b[i]) min2=b[i];
	}
	printf("%d\n",(sum-min)+(sum2-min2));
	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 <iostream>
#include <algorithm>
using namespace std;

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

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cmath>
#include <iomanip>
#include <string>
#include <queue>
#include <list>
#include <stack>

using namespace std;

/* constant */

const int INF = 1 << 30;
const int mod = 1000000007;

/* typedef */

typedef long long ll;

/* global variables */

/* function */

/* main */
int main() {

    vector<int> S(4);
    vector<int> T(2);
    for (int i = 0; i < S.size(); i++) {
        cin >> S[i];
    }
    for (int i = 0; i < T.size(); i++) {
        cin >> T[i];
    }

    sort(S.begin(), S.end());
    sort(T.begin(), T.end());

    int ans = accumulate(S.begin(), S.end(), 0) + accumulate(T.begin(), T.end(), 0)
                - S[0] - T[0];
    cout << ans << '\n';

}

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

int main() {
	vector<int> vec_1(4); vector<int> vec_2(2); int ans = 0;
	for (int i = 0; i < 4; i++) cin >> vec_1[i];
	sort(vec_1.begin(), vec_1.end(), greater<int>());
	for (int i = 0; i < 2; i++) cin >> vec_2[i];
	sort(vec_2.begin(), vec_2.end(), greater<int>());
	for (int i = 0; i < 3; i++) ans = ans + vec_1[i];
	for (int i = 0; i < 1; i++) ans = ans + vec_2[i];
	cout << ans << endl;
	return 0;
}

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

int main() {
	int a, b, c, d, e, f, g = 0;
	std::cin >> a >> b >> c >> d >> e >> f;
	g += a + b + c + d - std::min({ a, b, c, d });
	g += std::max(e, f);
	std::cout << g << std::endl;
}

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

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

using namespace std;

int A[6];
int main() {
    rep(i, 6) cin >> A[i];
    sort(A, A + 4);
    sort(A + 4, A + 6);
    int ans = 0;
    rep(i, 3) ans += A[i + 1];
    ans += A[5];
    cout << ans << endl;
    return 0;
}

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

int i, sumrika, sumsha, t, u, cnt=0;
int rika[5], sha[3];
int main(){
	int minrika=110, minsha=110;
	for(i=1; i<=4; i++){
	  cin>>rika[i]; sumrika+=rika[i];
	  it(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 <bits/stdc++.h>

using namespace std;

int main() {
    int a, b, c, d, e, f;
    cin >> a >> b >> c >> d >> e >> f;

    int ans = a + b + c + d - min({a, b, c, d}) + max(e, f);
    cout << ans << endl;
    return 0;
}

C++: #include<iostream>
#include <algorithm>
using namespace std;
int main()
{
    int n[4], h[2], i, l, g = 0;
    for (i = 0; i < 4; i++)
    {
        cin >> n[i];
    }
    for (i = 0; i<2; i++)
    {
        cin >> h[i];
    }
    for (i = 3; i >= 0; i--)
    {
        sort(n, n + 4);
    }
    l = n[3] + n[2] + n[1];
    if (h[0] > h[1])
        cout << l + h[0] << endl;
    else
        cout << l + h[1] << endl;
    return 0;
}

C++: #include<cstdio>
#include<algorithm>
#define rep(i,a) for(int i=0;i<(a);++i)

int a[6];

int main()
{
  rep( i, 6 )
    scanf( "%d", a+i );

  std::sort( a, a+4 );
  
  printf( "%d\n", a[1]+a[2]+a[3]+std::max( a[4], a[5] ) );
  
  return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int a[4],b[2];
	cin>>a[0]>>a[1]>>a[2]>>a[3]>>b[0]>>b[1];
	sort(a,a+4);
	sort(b,b+2);
	cout<<a[1]+a[2]+a[3]+b[1]<<endl;
	return 0;
}