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<string>
using namespace std;
int main(){
	int w[10],k[10];
	while(cin>>w[0]){
	for(int i=1;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 t=w[j];
	            w[j]=w[j-1];
	            w[j-1]=t;
	        }
        }
    }
	for(int i=0;i<9;i++){
        for(int j=9;j>i;j--){
	        if(k[j]>k[j-1]){
	            int t=k[j];
	            k[j]=k[j-1];
	            k[j-1]=t;
	        }
        }
    }
	cout<<w[0]+w[1]+w[2]<<" "<<k[0]+k[1]+k[2]<<endl;
	}
	return 0;
}

C++: #include<algorithm>
#include<cstdio>
#define s(A,B) std::sort(A,B);
int main(){
int W[10],K[10],p;
for(int i=0;i<20;i++)
scanf("%d",&p),(i<10)?W[i]=p:K[i-10]=p;
s(W,W+10);
s(K,K+10);
int Wp=W[7]+W[8]+W[9],Kp=K[7]+K[8]+K[9];
printf("%d %d\n",Wp,Kp);
}

C++: // Aizu Vol-5 0533: Contest
// 2017.8.30 bal4u@uu

#include <stdio.h>

int max[2][3];

int main()
{
	int i, j, p, s[2];

	for (j = 0; j < 2; j++) {
		for (i = 0; i < 10; i++) {
			scanf("%d", &p);
			if      (p > max[j][0]) max[j][2] = max[j][1], max[j][1] = max[j][0], max[j][0] = p;
			else if (p > max[j][1]) max[j][2] = max[j][1], max[j][1] = p;
			else if (p > max[j][2]) max[j][2] = p;
		}
		for (s[j] = i = 0; i < 3; i++) s[j] += max[j][i];
	}
	printf("%d %d\n", s[0], s[1]);
	return 0;
}

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

using namespace std;

int main(){
	
	vector<int> a;
	vector<int> b;
	
	for(int i=0;i<10;i++){
		int c;
		cin>>c;
		a.push_back(c);
	}
	
	for(int i=0;i<10;i++){
		int c;
		cin>>c;
		b.push_back(c);
	}
	
	
	sort(a.begin(), a.end());
	sort(b.begin(), b.end());
	
	
	printf("%d %d\n", a[7]+a[8]+a[9], b[7]+b[8]+b[9]);
}

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

using namespace std;

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

C++: #include <cstdio>
#include <algorithm>
using namespace std;
int W[10],K[10];
int main() {
	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);
	sort(K,K+10);
	int w=0,k=0;
	for(int i=7;i<=9;i++) w+=W[i],k+=K[i];
	printf("%d %d\n",w,k);
}

C++: #include <iostream>
using namespace std;
int main(void)
{
	int a,b,c[101]={0},d,e,f;
	for (a=0;a<10;a++)
	{
		cin>>b;
		c[b]=1;
	}
	d=0;
	e=0;
	for (a=100;a>=0;a--)
	{
		if (c[a]==1&&d!=3)
		{
			e=e+a;
			d++;
		}
	}
	c[101]={0};
	for (a=0;a<10;a++)
	{
		cin>>b;
		c[b]=1;
	}
	d=0;
	f=0;
	for (a=100;a>=0;a--)
	{
		if (c[a]==1&&d!=3)
		{
			f=f+a;
			d++;
		}
	}
	cout<<e<<" "<<f<<endl;
	return 0;
}

C++: #include<functional>
#include<algorithm>
#include<cstdio>

#define s(A,B) std::sort(A,B,std::greater<int>());

int main(){
	int W[21],K[21],p;
	for(int i=0;i<20;i++)
		scanf("%d",&p),(i<10)?W[i] = p:K[i-10] = p;
	s(W,W+10);
	s(K,K+10);
	int Wp = W[0] + W[1] + W[2],Kp = K[0] + K[1] + K[2];
	printf("%d %d\n",Wp,Kp);
	return 0;
}

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

int main(){

  int a[20],n=0,m=0;

  for(int i=0;i<20;i++) cin >> a[i];

  sort(a,a+10);
  reverse(a,a+10);

  sort(a+10,a+20);
  reverse(a+10,a+20);

  cout << a[0] + a[1] + a[2] << " " << a[10] + a[11] + a[12] << endl;

}

C++: #include <iostream>
#include <functional>
#include <algorithm>
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,greater<int>()); sort(b,b+10,greater<int>());
  cout << a[0] + a[1] + a[2] << " " << b[0] + b[1] + b[2] << endl;
}

C++: #include <iostream>
using namespace std;
int main(){
    int a[3]={},b[3]={};
    int x=0;
    
    for(int i=0;i<10;i++){
        cin>>x;
        if(x>a[0]){
             a[2]=a[1];
            a[1]=a[0];
            a[0]=x;
            }
        else if(x>a[1]){
            a[2]=a[1];
            a[1]=x;
        }
        else if(x>a[2])a[2]=x;
    }
    for(int j=0;j<10;j++){
        cin>>x;
        if(x>b[0]){
            b[2]=b[1];
            b[1]=b[0];
            b[0]=x;
        }
        else if(x>b[1]){
            b[2]=b[1];
            b[1]=x;
        }
        else if(x>b[2])b[2]=x;
    }
    
    int q=0,y=0;
    q=a[0]+a[1]+a[2];
    y=b[0]+b[1]+b[2];
    
    cout<<q<<" "<<y<<endl;
    


}

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

struct comp {
	bool operator()(int a, int b) const {
		return a > b;
	}
};

int main() {

	vector<int> w, k;
	int p, pw, pk;
	comp c;

	for (int i = 0; i < 10; ++i) {
		cin >> p;
		w.push_back(p);
	}
	for (int i = 0; i < 10; ++i) {
		cin >> p;
		k.push_back(p);
	}

	sort(w.begin(), w.end(), c);
	sort(k.begin(), k.end(), c);

	pw = 0;
	pk = 0;
	for (int i = 0; i < 3; ++i) {
		pw += w.at(i);
		pk += k.at(i);
	}

	cout << pw << " " << pk << endl;

	return 0;
}

C++: #include <iostream>
#include <algorithm>
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(w, w + 10);
	sort(k, k + 10);
	int wSum = 0, kSum = 0;
	for (int i = 9; i > 6; i--) {
		wSum += w[i];
	}
	for (int i = 9; i > 6; i--) {
		kSum += k[i];
	}
	cout << wSum << " " << kSum << endl;
	return 0;
}

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

int main(){
    int i,p,wans=0,kans=0;
    vector<int>W(10),K(10);
    for(i=0;i<10;i++)cin>>W[i];
    for(i=0;i<10;i++)cin>>K[i];
    sort(W.begin(),W.end());
    sort(K.begin(),K.end());
    wans=W[9]+W[8]+W[7];
    kans=K[9]+K[8]+K[7];
    printf("%d %d\n",wans,kans);
}

C++: #include <iostream>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <math.h>
#include <map>
#include <queue>
#include <string>
#include <vector>
using namespace std;

int a[10],b[10];

int main(){
	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[7]+a[8]+a[9]<<" "<<b[7]+b[8]+b[9]<<endl;
}

C++: #include<stdio.h>
int main()
{
	int a[10];
	int b[10];
	int maxa1=0;
	int maxa2=0;
	int maxa3=0;
	int maxb1=0;
	int maxb2=0;
	int maxb3=0;
	int i;
	
	for(i=0;i<10;i++)
	{
		scanf("%d",&a[i]);
			if(a[i]>=maxa3)
			{
				if(a[i]>=maxa2)
				{
					if(a[i]>=maxa1)
					{
						maxa3=maxa2;
						maxa2=maxa1;
						maxa1=a[i];
					}
					else
					{
						maxa3=maxa2;
						maxa2=a[i];
					}
				}
				else
				{
					maxa3=a[i];
				}
			}
	}
	for(i=0;i<10;i++)
	{
		scanf("%d",&b[i]);
			if(b[i]>=maxb3)
			{
				if(b[i]>=maxb2)
				{
					if(b[i]>=maxb1)
					{
						maxb3=maxb2;
						maxb2=maxb1;
						maxb1=b[i];
					}
					else
					{
						maxb3=maxb2;
						maxb2=b[i];
					}
				}
				else
				{
					maxb3=b[i];
				}
			}
	}
	
	printf("%d %d\n",maxa1+maxa2+maxa3,maxb1+maxb2+maxb3);
}

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

using namespace std;

#define str to_string
#define rep(i, n) for (int i=0; i<int(n); i++)
#define all(c) (c).begin(), (c).end()


int w[10];
int k[10];

int main() {
  rep(i, 10) cin >> w[i];
  rep(i, 10) cin >> k[i];

  sort(w, w+10);
  sort(k, k+10);
  cout << w[9]+w[8]+w[7] << " " << k[9]+k[8]+k[7] << "\n";
  return 0;
}