Go: package main

import (
	"fmt"
	"sort"
)

func calcScore(n, m []int) (int, int) {
	sort.Ints(n)
	sort.Ints(m)
	
	return n[9] + n[8] + n[7], m[9] + m[8] + m[7]
}

func main(){
	var team_W, team_K []int
	var inp int
	
		for i := 0; i < 10; i++ {		
			fmt.Scan(&inp)
			team_W = append(team_W, inp)
		}

		for j := 0;  j< 10; j++ {		
			fmt.Scan(&inp)
			team_K = append(team_K, inp)
		}

	fmt.Println(calcScore(team_W, team_K))
}

C++: #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define EQ(a,b) (abs((a)-(b))<EPS)
int main()
{
	vector<int> w,h;
	for(int i=0;i<10;i++)
	{
		int k;
		cin >> k;
		w.pb(k);
	}
	for(int i=0;i<10;i++)
	{
		int k;
		cin >> k;
		h.pb(k);
	}
	sort(w.begin(),w.end(),greater<int>());
	sort(h.begin(),h.end(),greater<int>());
	int sumw=0,sumh=0;
	for(int i=0;i<3;i++)
	{
		sumw+=w[i];
		sumh+=h[i];
	}
	cout << sumw << ' ' << sumh << endl;
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int w[10],k[10];
	int i,j,temp;
	int wm,km;
	for(i=0;i<10;i++){
		scanf("%d",&w[i]);
	}
	for(i=0;i<9;i++){
		for(j=i+1;j<10;j++){
			if(w[i]<w[j]){
				temp=w[i];
				w[i]=w[j];
				w[j]=temp;
			}
		}
	}
	wm=w[0]+w[1]+w[2];
	
	for(i=0;i<10;i++){
		scanf("%d",&k[i]);
	}
	for(i=0;i<9;i++){
		for(j=i+1;j<10;j++){
			if(k[i]<k[j]){
				temp=k[i];
				k[i]=k[j];
				k[j]=temp;
			}
		}
	}
	km=k[0]+k[1]+k[2];
	
	printf("%d %d\n",wm,km);
	return 0;
}

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

int main(){
	int ar[10];
	int br[10];
	
	for(int i=0;i<10;i++){
		cin>>ar[i];
		}
		
	for(int i=0;i<10;i++){
		cin>>br[i];
		}	
		sort(ar,ar+10);
		sort(br,br+10);
		int c=ar[7]+ar[8]+ar[9];
		int d=br[7]+br[8]+br[9];
		
		cout<<c<<" "<<d<<endl;
		return 0;
		
	}

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

using namespace std;

int main(){
	vector<int> w ,k;
	int n;
	for(int i = 0; i < 20; i++){
		cin >> n;
		if(i < 10){
			w.push_back(n);
		}else{
			k.push_back(n);
		}
	}
	sort(w.begin(), w.end());
	sort(k.begin(), k.end());
	cout << w[9] + w[8] + w[7] << " " << k[9] + k[8] + k[7]  << endl; 

}

C++: #include<iostream>
#include<algorithm>
int W[10],K[10];
int wmax,kmax;
int main(){	  
	for(int i=0;i<10;i++)
		std::cin>>W[i];
	for(int i=0;i<10;i++)
		std::cin>>K[i];
	std::sort(W,W+10);
	std::sort(K,K+10);
	wmax=W[9]+W[8]+W[7];
	kmax=K[9]+K[8]+K[7];
	std::cout<<wmax<<" "<<kmax<<std::endl;
}

C++: #include<iostream>
using namespace std;
int main(){
int s[10], s2[10];
int sum1=0, sum2=0;
for (int i = 0 ; i < 10 ; i++) {
  cin >> s[i];
}
for (int i = 0 ; i < 10 ; i++) {
  cin >> s2[i];
}
for (int i = 0 ; i < 10 ; i++) {
  for (int j=i+1 ; j<10 ; j++){
    if (s[j]>s[i]){
      int t = s[i];
      s[i] = s[j];
      s[j] = t;
    }
  }
}
for (int i = 0 ; i < 10 ; i++) {
  for (int j=i+1 ; j<10 ; j++){
    if (s2[j]>s2[i]){
      int t = s2[i];
      s2[i] = s2[j];
      s2[j] = t;
    }
  }
}
for (int i = 0 ; i < 3 ; i++) {
  sum1+=s[i];
}
for (int i = 0 ; i < 3 ; i++) {
  sum2+=s2[i];
}
cout << sum1 << " " << sum2 <<endl;
}

C++: #include <iostream>
#include <algorithm>
#define MEMBER 20
using namespace std;
int n=MEMBER,k=0;
int score[MEMBER];
int main(){
	while(k!=n){
		cin >>score[k];
		k++;
	}
	sort(score,score+(10));
	sort(score+(10),score+(20));
	k=0;
	while(k!=n){
		cout <<score[k]<< " ";
		k++;
	}
	cout << score[7]+score[8]+score[9]<<" ";
	cout << score[17]+score[18]+score[19]<<endl;
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int a[10],b[10];
  for(int i=0;i<10;i++)cin>>a[i];
  for(int i=0;i<10;i++)cin>>b[i];
  sort(a,a+10);
  sort(b,b+10);
  cout<<a[9]+a[8]+a[7]<<" "<<b[9]+b[8]+b[7]<<endl;
  return 0;
}

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

void solve() {
    std::vector<int> xs(10);
    for (auto& x : xs) std::cin >> x;
    std::sort(xs.rbegin(), xs.rend());
    std::cout << std::accumulate(xs.begin(), xs.begin() + 3, 0);
}

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

    for (int i = 0; i < 2; ++i) {
        solve();
        std::cout << " \n"[i];
    }

    return 0;
}

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

/*int main(int argc, char **argv)
{
	int a, b, c, d, e;
	std::cin >> a >> b >> c >> d >> e;
	std::cout << std::min(a, std::min(b, c)) + std::min(d, e) - 50 << std::endl;
	return 0;
}*/
/*int main()
{
	int l, a, b, c, d;
	std::cin >> l >> a >> b >> c >> d;
	int japa, math;
	japa = a / c;
	if(a % c != 0){
		japa++;
	}
	math = b / d;
	if(b % d != 0){
		math++;
	}
	std::cout << l - std::max(japa, math) << std::endl;
}*/
/*int main()
{
	bool sub[31];
	int input;
	for(int i = 0; i < 31; i++){
		sub[i] = false;
	}
	for(int i = 0; i < 28; i++){
		std::cin >> input;
		sub[input] = true;
	}
	for(int i = 1; i < 31; i++){
		if(!sub[i]) std::cout << i << std::endl;
	}
}*/
int main()
{
	std::vector<int> w, k;
	int input;
	for(int i = 0; i < 10; i++){
		std::cin >> input;
		w.push_back(input);
	}
	for(int i = 0; i < 10; i++){
		std::cin >> input;
		k.push_back(input);
	}
	std::sort(w.begin(),w.end(),std::greater<int>());
	std::sort(k.begin(),k.end(),std::greater<int>());
	std::cout << w[0] + w[1] + w[2] << " " << k[0] + k[1] + k[2] << std::endl;
}

C++: #include<cstdio>
int main(){
	int w1,w2,w3,k1,k2,k3;
	int a;
	w1=w2=w3=k1=k2=k3=0;
	for(int i=0;i<10;i++){
		scanf("%d",&a);
		if(a>w1){
			w3=w2;
			w2=w1;
			w1=a;
		}else if(a>w2){
			w3=w2;
			w2=a;
		}else if(a>w3){
			w3=a;
		}
	}
	for(int i=0;i<10;i++){
		scanf("%d",&a);
		if(a>k1){
			k3=k2;
			k2=k1;
			k1=a;
		}else if(a>k2){
			k3=k2;
			k2=a;
		}else if(a>k3){
			k3=a;
		}
	}

	printf("%d %d\n",w1+w2+w3,k1+k2+k3);

	return 0;
}

C++: /**********************************************

1.
2.炭田高輝
3.sumita.takaki@gmail.com

last updated: 2013-07-10@12:35

 **********************************************/
#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){
                
        vector<int> w_uni(10);
        vector<int> k_uni(10);

        for(int i=0; i<10; i++){
                cin >> w_uni[i];
        }

        for(int i=0; i<10; i++){
                cin >> k_uni[i];                
        }

        sort(w_uni.begin(), w_uni.end());
        sort(k_uni.begin(), k_uni.end());

        int total1 = w_uni[7] + w_uni[8] + w_uni[9];
        int total2 = k_uni[7] + k_uni[8] + k_uni[9];

        if(total1 == 0 && total2 == 0)break;

        cout << total1 << ' '<< total2 << endl;

        }
        

}

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

using namespace std;

int main() {
	int w[10];
	int k[10];
	for (int i = 0; i < 10; i++){
		cin >> w[i];
	}
	for (int i = 0; i < 10; i++) {
		cin >> k[i];
	}
	sort(k, k + 10);
	sort(w, w + 10);
	cout << w[9] + w[8] + w[7] << " " << k[9] + k[8] + k[7] << endl;
}

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

int main()
{
  vector<vector<int> > p(2, vector<int>(10));
  for (int i = 0; i < 2; ++i) {
    for (int j = 0; j < 10; ++j)
      cin >> p[i][j];
  }
  sort(p[0].begin(), p[0].end(), greater<int>());
  sort(p[1].begin(), p[1].end(), greater<int>());
  cout << p[0][0]+p[0][1]+p[0][2] << " " << p[1][0]+p[1][1]+p[1][2] << endl;
  return 0;
}