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 <algorithm>

using namespace std;

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

C++: using namespace std;
int main(){
	int p[10];
	for(int i=0;i<2;i++){
		for(int j=0;j<10;j++)cin>>p[j];
		sort(p,p+10);
		if(i)cout<<" ";
		cout<<p[7]+p[8]+p[9];
	}
	cout<<endl;
	return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
  vector<int>W(10);
  vector<int>H(10);
  for(int i=0;i<10;i++)
    cin>>W[i];
  for(int i=0;i<10;i++)
    cin>>H[i];
  sort(W.begin(),W.end(),greater<int>());
  sort(H.begin(),H.end(),greater<int>());
  cout<<W[0]+W[1]+W[2]<<" "<<H[0]+H[1]+H[2]<<endl;
  return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int W_score, W_1=0, W_2=0, W_3=0, K_score, K_1=0, K_2=0, K_3=0;
    for(int i=0; i<10; i++){
        cin >> W_score;
        if(W_score > W_1){
            W_3=W_2;
            W_2=W_1;
            W_1=W_score;
        }
        else if(W_score > W_2){
            W_3=W_2;
            W_2=W_score;
        }
        else if(W_score > W_3){
            W_3=W_score;
        }
    }
    cout << W_1+W_2+W_3 << " ";
    
    for(int i=0; i<10; i++){
        cin >> K_score;
        if(K_score > K_1){
            K_3=K_2;
            K_2=K_1;
            K_1=K_score;
        }
        else if(K_score > K_2){
            K_3=K_2;
            K_2=K_score;
        }
        else if(K_score > K_3){
            K_3=K_score;
        }
    }
    cout << K_1+K_2+K_3 << endl;
    return 0;
}

C++: // 2011/09/08 Tazoe

#include <iostream>
using namespace std;

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

	int K[10];
	for(int i=0; i<10; i++)
		cin >> K[i];

	for(int i=0; i<9; i++)
		for(int j=i+1; j<10; j++)
			if(W[i]<W[j]){
				int tmp = W[i];
				W[i] = W[j];
				W[j] = tmp;
			}

	for(int i=0; i<9; i++)
		for(int j=i+1; j<10; j++)
			if(K[i]<K[j]){
				int tmp = K[i];
				K[i] = K[j];
				K[j] = tmp;
			}

	cout << W[0]+W[1]+W[2] << ' ' << K[0]+K[1]+K[2] << endl;

	return 0;
}

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

int main(){
int N[11]={},W[11]={},x;
int Ns=0,Ws=0;
for(int i=0;i<10;i++)
{cin>>N[i];}
for(int i=0;i<10;i++)
{cin>>W[i];}
for(int i=0;i<10;i++)
{for(int j=9;j>j;j--)
{if(N[j]>N[j-1]){int t=N[j];N[j]=N[j-1];N[j-1]=t;}
 if(W[j]>W[j-1]){int t=W[j];W[j]=W[j-1];W[j-1]=t;}
}
}
for(int i=0;i<3;i++)
{Ns+=N[i];Ws+=W[i];}
cout<<Ns<<" "<<Ws<<endl;
return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
int main(){
	int w[10],k[10];
	for(int i=0;i<10;i++)
		cin>>w[i];
	for(int i=0;i<10;i++)
		cin>>k[i];
	for(int i=0;i<9;i++){
		for(int j=9;j>i;j--){
			if(w[j]>w[j-1]){
				int tmp=w[j];
				w[j]=w[j-1];
				w[j-1]=tmp;
			}
		}
	}
	for(int i=0;i<9;i++){
		for(int j=9;j>i;j--){
			if(k[j]>k[j-1]){
				int tmp=k[j];
				k[j]=k[j-1];
				k[j-1]=tmp;
			}
		}
	}
	cout<<w[0]+w[1]+w[2]<<" "<<k[0]+k[1]+k[2]<<endl;
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int P1[15],P2[15],tmp;
  for(int i=0;i<10;i++){
    cin >> P1[i];
  }
  for(int i=0;i<10;i++){
    cin >> P2[i];
  }
  for(int i=0;i<9;i++){
    for(int j=9;j>i;j--){
      if(P1[j]>P1[j-1]){
	tmp=P1[j];
	P1[j]=P1[j-1];
	P1[j-1]=tmp;
      }
      if(P2[j]>P2[j-1]){
	tmp=P2[j];
	P2[j]=P2[j-1];
	P2[j-1]=tmp;
      }
    }
  }
  cout << P1[0]+P1[1]+P1[2] << " " << P2[0]+P2[1]+P2[2] << endl;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
char h[3]={ ,\n};
int main()
{
int w[3],x;
for(int j=0;j<2;j++){
 memset(w,0,sizeof(w));
 for(int i=0;i<10;i++){
 scanf("%d",&x);
 if(x>w[0]){w[2]=w[1]; w[1]=w[0]; w[0]=x;}
 else if(x>w[1]) {w[2]=w[1]; w[1]=x;}
 else if(x>w[2]) w[2]=x;
 }
 printf("%d%c",w[0]+w[1]+w[2],h[j]);
}
}

C++: #include<algorithm>
#include<cstdio>
#define s(A) std::sort(A,A+10);
main(){
int Z[20],p;
for(int i=0;i<20;i++)
scanf("%d",&p),Z[i]=p;
s(Z);
s(Z+10);
printf("%d %d\n",Z[7]+Z[8]+Z[9],Z[17]+Z[18]+Z[19]);
}

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

int main() {

    priority_queue<int> pq;
    priority_queue<int> pq2;
    int tmp, sum = 0;
    for (int i = 0; i < 10; i++) {
        std::scanf("%d", &tmp); pq.push(tmp);
    }
    for (int i = 0; i < 10; i++) {
        std::scanf("%d", &tmp); pq2.push(tmp);
    }
    for (int i = 0; i < 3; i++) {
        sum += pq.top(); pq.pop();
    }
    std::printf("%d ", sum); sum = 0;
    for (int i = 0; i < 3; i++) {
        sum += pq2.top(); pq2.pop();
    }
    std::printf("%d\n", sum); sum = 0;
    return 0;
}

C++: //
//  main.cpp

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


int main(){	
	vector<int>W,K;
	int input;
	for(int i=0;i<10;i++){
		cin >> input;
		W.push_back(input);
	}
	for(int i=0;i<10;i++){
		cin >> input;
		K.push_back(input);
	}
	sort(W.begin(),W.end());
	sort(K.begin(),K.end());
	
	cout << W[9] + W[8] + W[7] << " " << K[9] + K[8] + K[7] << endl;
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<30
#define pb push_back
#define mp make_pair

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

int main() {
	int n = 10;
	vector<int> a(n), b(n);

	rep(i, n) cin >> a[i];
	rep(i, n) cin >> b[i];

	sort(a.begin(), a.end(), greater<int>());
	sort(b.begin(), b.end(), greater<int>());

	cout << a[0] + a[1] + a[2] << " " << b[0] + b[1] + b[2] << endl;

	return 0;
}

C++: #include<algorithm>
#include<cstdio>
#define s(A)std::sort(A,A+10);
main(){
int Z[20],i=0;
for(;i<20;)
scanf("%d",Z+i++);
s(Z);
s(Z+10);
printf("%d %d\n",Z[7]+Z[8]+Z[9],Z[17]+Z[18]+Z[19]);
}

C++: #include <bits/stdc++.h>
using namespace std;

int main(){
    int arr[20];
    for(int x = 0; x < 20; ++x){
        scanf("%d", arr+x);
    }
    sort(arr,  arr+10, greater<int>());
    sort(arr+10,  arr+20, greater<int>());
    printf("%d %d\n",  arr[0]+arr[1]+arr[2], arr[10]+arr[11]+arr[12]);
    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int a,a1=0,a2=0,a3=0,h;
	for(int i=0;i<10;i++){
		cin >> a ;
		if(a>=a1){a3=a2;a2=a1;a1=a;}
		else if(a>=a2){a3=a2;a2=a;}
		else if(a>=a3){a3=a;}
	}
	h=a1+a2+a3;
	a1=0,a2=0,a3=0,h;
	for(int i=0;i<10;i++){
		cin >> a ;
		if(a>=a1){a3=a2;a2=a1;a1=a;}
		else if(a>=a2){a3=a2;a2=a;}
		else if(a>=a3){a3=a;}
	}
	cout << h << " " << a1+a2+a3 << endl;

	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
int main() {
	std::vector<int> w(10), k(10);
	for (int i = 0; i < 10; i += 1)
		std::cin >> w[i];
	for (int i = 0; i < 10; i += 1)
		std::cin >> k[i];
	std::sort(w.begin(), w.end());
	std::sort(k.begin(), k.end());
	std::cout << w[7] + w[8] + w[9] << std::endl;
	std::cout << k[7] + k[8] + k[9] << std::endl;
	return 0;
}