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 <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
	vector<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.begin(), a.end());
	sort(b.begin(), b.end());
	cout << a[7]+a[8]+a[9] << " " << b[7]+b[8]+b[9] << endl;
	return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

int total3 (multiset <int, greater<int> > s )
{
	multiset <int, greater<int> >::iterator it = s.begin();
	int res = 0;
	int i;

	for (i = 0; i < 3; ++i, ++it){
		res += (*it);
	} // end for

	return res;
}

int main()
{
//	cut here before submit 
//	freopen ("testcase.contest2", "r", stdin );
	string str = "";

	int i;
	multiset <int, greater<int> > scoreW, scoreK;

	for (i = 0; i < 10; ++i){
		int score;
		getline (cin, str );

		stringstream ssw(str);
		ssw >> score;
		scoreW.insert (score );
//		cout << "scoreW: " << score << endl;
	} // end loop
	for (i = 10; i < 20; ++i){
		int score;
		getline (cin, str );

		stringstream ssk(str);
		ssk >> score;
		scoreK.insert (score );
//		cout << "scoreK: " << score << endl;
	} // end for

	int resW = total3 (scoreW );
	int resK = total3 (scoreK );

	cout << resW << ' ' << resK << endl;
		
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;

#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define range(i,a,n) for(int i=(a);i<(n);i++)

#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI 3.1415926535897932384

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};

template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S acm(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
void YN(bool b){cout<<(b?"YES":"NO")<<"\n";}
void Yn(bool b){cout<<(b?"Yes":"No")<<"\n";}
void yn(bool b){cout<<(b?"yes":"no")<<"\n";}

ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s;a=0;} return os;}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	vl ww(10),kk(10);
	rep(i,10)cin>>ww[i];
	rep(i,10)cin>>kk[i];
	sort(all(ww),greater<ll>());
	sort(all(kk),greater<ll>());
	cout<<ww[0]+ww[1]+ww[2]<<" "<<kk[0]+kk[1]+kk[2]<<endl;
}

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

using namespace std;

int main(){
	int waseda[10];
	int keo[10];
	for(int i = 0; i < 10; i++){
		cin >> waseda[i];
	}
	for(int i = 0; i < 10; i++){
		cin >> keo[i];
	}
	sort(waseda,waseda+10,greater<int>());
	sort(keo,keo+10,greater<int>());

	int sumW=0;
	int sumK=0;
	for(int i = 0; i < 3; i++){
		sumW += waseda[i];
		sumK += keo[i];
	}
	cout << sumW << " " << sumK << endl;

	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int w[10],k[10];
	int ws,ks;
	int i,j,temp;
	ws=0;
	ks=0;
	
	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;
			}
		}
	}
	ws=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;
			}
		}
	}
	ks=k[0]+k[1]+k[2];
	
	printf("%d %d\n",ws,ks);
	return 0;
}

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

using namespace std;

int main(){
	int w[10],k[10];
	int temp;
	
	for(int i=0;i<10;i++) scanf("%d",&w[i]);
	for(int i=0;i<10;i++) scanf("%d",&k[i]);
	for(int i=0;i<10;i++){
		for(int j=i+1;j<10;j++){
			if(w[i]<w[j]){
				temp = w[i];
				w[i] = w[j];
				w[j] = temp;
			}
			if(k[i]<k[j]){
				temp = k[i];
				k[i] = k[j];
				k[j] = temp;
			}
		}
	}
	printf("%d %d\n",w[0]+w[1]+w[2],k[0]+k[1]+k[2]);
}

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

using namespace std;

main(){
  int data1[10], data2[10];
  while(cin >> data1[0]){
    for(int i=1;i<10;i++){
      cin >> data1[i];
    }
    for(int i=0;i<10;i++){
      cin >> data2[i];
    }

    sort(data1, data1+10);
    sort(data2, data2+10);
    cout << data1[7]+data1[8]+data1[9] << endl;
    cout << data2[7]+data2[8]+data2[9] << endl;
  }
  return 0;
}

C++: #include<vector>
#include<list>
#include<algorithm>
#include<iostream>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
  int h,i;
  int a[10],b[10];
  for(i=0;i<10;i++)
    cin>>a[i];
  for(i=0;i<10;i++)
    cin>>b[i];
  do{
    h=0;
    for(i=1;i<10;i++){
      if(a[i-1]<a[i]){
	swap(a[i-1],a[i]);
	h=1;
      }
    }
  }while(h);
  do{
    h=0;
    for(i=1;i<10;i++){
      if(b[i-1]<b[i]){
	swap(b[i-1],b[i]);
	h=1;
      }
    }
  }while(h);
  cout<<a[0]+a[1]+a[2]<<" "<<b[0]+b[1]+b[2]<<endl;
  return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(void)
{
	int n[10],k[10],a,b;
	for(int i=0;i<10;i++)
	{
		cin>>n[i];
	}
	sort(n,n+10);
	a=n[9]+n[8]+n[7];
	for(int i=0;i<10;i++)
	{
		cin>>k[i];
	}
	sort(k,k+10);
	b=k[9]+k[8]+k[7];
	cout<<a<<" "<<b<<endl;
	return 0;
}