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 <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(void)
{
  int point;
  vector<int> science;
  vector<int> society;

  for(int i=0;i<6;i++)
    {
      cin >> point;
      
      if(i<4)
	science.push_back(point);
      else
	society.push_back(point);

    }

  sort(science.begin(),science.end(),greater<int> ());
  sort(society.begin(),society.end(),greater<int> ());
  
  cout << science[0]+science[1]+science[2]+society[0] << endl;

  return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int ans = 0,sum=0;
	int a, b, c, d, e, f;
	cin >> a >> b >> c >> d >> e >> f;
	ans += max(e, f);
	sum += a + b + c + d;
	sum -= min(min(a, b), min(c, d));
	cout << sum + ans << endl;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int a,b,c,d,e,f;
    cin>>a>>b>>c>>d>>e>>f;
    int m;
    m=a;
    if(m>b) m=b;
    if(m>c) m=c;
    if(m>d) m=d;
    if(e<f) cout<<a+b+c+d-m+f;
    if(e>=f)    cout<<a+b+c+d-m+e;
    cout<<endl;
}

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

int main() {
  int A, B, C, D, E, F; cin >> A >> B >> C >> D >> E >> F;
  int min = 100, ans = 0;
  ans += A; if (A < min) min = A;
  ans += B; if (B < min) min = B;
  ans += C; if (C < min) min = C;
  ans += D; if (D < min) min = D;
  ans -= min; min = 100;
  ans += E; if (E < min) min = E;
  ans += F; if (F < min) min = F;
  ans -= min;
  cout << ans << endl;
  return 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++: #include <bits/stdc++.h>
using namespace std;

int main()
{
  int sum = 0;
  int a, b, m = 101;

  for (int i = 0; i < 4; i++){
    cin >> a;
    m = min(a, m);
    sum += a;
  }

  sum -= m;

  cin >> a >> b;

  sum += max(a, b);

  cout << sum << endl;
}

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

int main() {
	int a[4];
	for (int b = 0; b < 4; b++) {
		scanf("%d", &a[b]);
	}
	sort(a, a + 4);
	int sum = a[1] + a[2] + a[3];
	int p, q;
	cin >> p >> q;
	sum += max(p, q);
	cout << sum << 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 <bits/stdc++.h>
#define fo(i,a) for(i = 0;i < a;i++)
using namespace std;

int main(void)
{
	int t,h,s[4]={0};
	
	fo(t,4){
		cin >> s[t];
	}
	sort(s,s+4);
	cin >> h;
	cin >> t;
	s[0] = max(h,t);
	cout << s[0]+s[1]+s[2]+s[3] << endl;
	
	return 0;
}

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

using namespace std;

int main(void)
{
  int point;
  vector<int> science;
  vector<int> society;

  for(int i=0;i<6;i++)
    {
      cin >> point;
      
      if(i<4)
	science.push_back(point);
      else
	society.push_back(point);

    }

  sort(science.begin(),science.end(),greater<int> ());
  sort(society.begin(),society.end(),greater<int> ());

  cout <<science[0]<<endl;
  

  cout << science[0]+science[1]+science[2]+society[0] << endl;

  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
#define HAPPY_BIRTHDAY 0
int A,B,C,D,E,F;
int main(){
  cin>>A>>B>>C>>D>>E>>F;
  cout<<A+B+C+D-min(min(A,B),min(C,D))+max(E,F)<<endl;
  return HAPPY_BIRTHDAY;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int data[4],a,b;
  for(int i=0;i<4;i++){
    cin >> data[i];
  }
  cin >> a >> b;
  for(int i=0;i<3;i++){
    if(data[i] < data[i+1]){
      swap(data[i],data[i+1]);
    }
  }
  if(a > b){
    cout << data[0]+data[1]+data[2]+a << endl;
  } else{
    cout << data[0]+data[1]+data[2]+b << endl;
  }
  return 0;
}

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

int main(){
	int s[4];
	int m_max;
	int h[3];
	int h_max;
	for(int i = 0;i<4;i++){
		cin>>s[i];
		m_max += s[i];
	}
	m_max -= (min(s[0],min(s[1],min(s[2],s[3]))));
	for(int i = 0;i<3;i++){
		cin>>h[i];
		h_max+=h[i];
	}
	h_max -= (min(h[0],min(h[1],h[2])));
	m_max += h_max;
	cout<<m_max<<endl;
}

C++: #include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<stdlib.h>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=500000004;
int a[6];
int main(){
	for(int i=0;i<6;i++){
		scanf("%d",a+i);
	}
	printf("%d\n",a[0]+a[1]+a[2]+a[3]+max(a[4],a[5])-min(min(a[0],a[1]),min(a[2],a[3])));
}

C++: #include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int sum = 0;
	int m = 10000;

	for (int i = 0;i < 4;i++){
		int tmp; cin >> tmp;
		sum += tmp;
		m = min(m,tmp);
	}	

	int a,b; cin >> a >> b;

	cout << sum-m+max(a,b) << endl;

	return 0;

}

C++: #include<iostream>
using namespace std;
int main()
{
	int a[6],i,j,t,m=0;
	for(i=0;i<6;i++)
	{
		cin>>a[i];
	}
	for(i=0;i<4;i++)
	{
		for(j=i+1;j<4;j++)
		{
			if(a[i]<a[j])
			{
				t=a[i];
				a[i]=a[j];
				a[j]=t;
			}
		}
	}
	if(a[4]<a[5])
	{	
		t=a[4];
		a[4]=a[5];
		a[5]=t;
	}
	for(i=0;i<3;i++)
	{
		m=m+a[i];
	}
	cout<<m+a[4]<<endl;
	return 0;
}

C++: #include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-8;
const int inf=1e8;
int main(){
	vi in(6);
	rep(i,6)cin>>in[i];
	sort(in.begin(),in.begin()+4);
	int out=0;
	rep(i,3)out+=in[i+1];
	cout<<out+max(in[4],in[5])<<endl;
}

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

int main(int argc, char *argv[])
{
  int point, sum = 0;
  vector<int> v1, v2;
  
  for (int i = 0; i < 4; i++) {
    cin >> point;
    v1.push_back(point);
  }
  for (int i = 0; i < 2; i++) {
    cin >> point;
    v2.push_back(point);
  }

  sort(v1.begin(), v1.end(), greater<int>());
  sort(v2.begin(), v2.end(), greater<int>());
  
  for (int i = 0; i < 3; i++) {
    sum += v1[i];
  }
  sum += v2[0];

  cout << sum << endl;;
  
  return 0;
}