Go: package main

import "fmt"

func main() {
	var a1, a2, a3, a4, b1, b2, b3, b4 int
	for {
		i, _ := fmt.Scan(&a1, &a2, &a3, &a4)
		if i == 0 {
			break
		}
		fmt.Scan(&b1, &b2, &b3, &b4)
		a := [4]int{a1, a2, a3, a4}
		b := [4]int{b1, b2, b3, b4}
		var hit, blow int

		for j := 0; j < 4; j++ {
			for k := 0; k < 4; k++ {
				if a[j] == b[k] {
					if j == k {
						hit++
					} else {
						blow++
					}
				}
			}
		}
		fmt.Println(hit, blow)
	}
}

C++: #include<iostream>
using namespace std;
int main(){
    int a,b,c,d,e,f,g,h,x,y;
    
    while (cin >> a >> b >> c >> d >> e >> f >> g >> h) {
    x = 0;
    y = 0;
        if (a==e){x=x+1 ;e=e+10;} 
        if (b==f){x=x+1;f=f+10;} 
        if (c==g){x=x+1;g=g+10;}
        if (d==h){x=x+1;h=h+10;}
        if (e==a || e==b || e==c || e==d){y=y+1;}
        if (f==a || f==b || f==c || f==d){y=y+1;}
        if (g==a || g==b || g==c || g==d){y=y+1;}
        if (h==a || h==b || h==c || h==d){y=y+1;}
        cout << x << " " <<  y << endl;
    }
    
return 0 ;
}

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

int main(){
	std::array < int, 4>a;
	std::array < int, 4>b;
	
	while(std::cin >> a[0] >> a[1] >> a[2] >> a[3]){
		int hit, blow;
		hit = blow = 0;
		std::cin >> b[0] >> b[1] >> b[2] >> b[3];
		for(int i=0; i<4; ++i){
			if(a[i] == b[i]){
				++hit;
			} else{
				for(int j=0; j<4; ++j){
					if(a[i] == b[j]){
						++blow;
					}
				}
			}
		}
		std::cout << hit << ' ' << blow << std::endl;
	}
	
	return 0;
}

C++: #include "stdio.h"

int main ()
{
    int a[6],b[6];
    while (scanf("%d%d%d%d%d%d%d%d",&a[1],&a[2],&a[3],&a[4],&b[1],&b[2],&b[3],&b[4])!=EOF)
    {
        int hit=0,blow=0,i,j;
        for (i=1;i<=4;i++)
            if (a[i]==b[i])
                hit++;

        for (i=1;i<=4;i++)
            for(j=1;j<=4;j++)
            {if (a[i]==b[j])
                blow++;
            }

        printf("%d %d\n",hit,blow-hit);

    }
}

C++: #include<iostream>
using namespace std;
int t[4],u[4],v[4];

int main(){
  int h,b;
  while(cin>>t[0]){
    for(int i=1;i<4;i++)cin>>t[i];
  for(int i=0;i<4;i++)cin>>u[i];
    h=b=0;
    for(int i=0;i<4;i++){
      if(t[i]==u[i])h++;
      else{
    for(int j=0;j<4;j++){
      if(t[i]==u[j])b++;
    }
      }
    }
    cout<<h<<' '<<b<<endl;
  }
  return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main(void){
    int a,b,c,d;
    while(cin>>a>>b>>c>>d){



	int w,x,y,z;
	int hit=0,blow=0;
	cin>>w>>x>>y>>z;
	if(w==a)a=-1,hit++;
	else if(w==b)b=-1,blow++;
	else if(w==c)c=-1,blow++;
	else if(w==d)d=-1,blow++;
	if(x==b)b=-1,hit++;
	else if(x==a)a=-1,blow++;
	else if(x==c)c=-1,blow++;
	else if(x==d)d=-1,blow++;
	if(y==c)c=-1,hit++;
	else if(y==b)b=-1,blow++;
	else if(y==a)a=-1,blow++;
	else if(y==d)d=-1,blow++;
	if(z==d)d=-1,hit++;
	else if(z==b)b=-1,blow++;
	else if(z==c)c=-1,blow++;
	else if(z==a)a=-1,blow++;
	cout<<hit<<" "<<blow<<endl;
    }


	return 0;
}

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

int main() {
  vector<int>a(4);
  vector<int>b(4);
  while(cin >>a.at(0)>>a.at(1)>>a.at(2)>>a.at(3)>>b.at(0)>>b.at(1)>>b.at(2)>>b.at(3)){
    int hit=0;
    int blow=0;
    for(int i=0;i<4;i++){
      if(a.at(i)==b.at(i)){
        hit++;
      }
    }
    if(a.at(0)==b.at(1)){
      blow++;
    }
    if(a.at(0)==b.at(2)){
      blow++;
    }
    if(a.at(0)==b.at(3)){
      blow++;
    }
    if(a.at(1)==b.at(0)){
      blow++;
    }
    if(a.at(1)==b.at(2)){
      blow++;
    }
    if(a.at(1)==b.at(3)){
      blow++;
    }
    if(a.at(2)==b.at(0)){
      blow++;
    }
    if(a.at(2)==b.at(1)){
      blow++;
    }
    if(a.at(2)==b.at(3)){
      blow++;
    }
    if(a.at(3)==b.at(0)){
      blow++;
    }
    if(a.at(3)==b.at(1)){
      blow++;
    }
    if(a.at(3)==b.at(2)){
      blow++;
    }
  cout <<hit<<" "<<blow<<endl;
  }
  return 0;
}

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

int main(){
  vector<int> a(4), b(4);

  while (cin >> a.at(0) >> a.at(1) >> a.at(2) >> a.at(3) >> b.at(0) >> b.at(1) >>
b.at(2) >> b.at(3)) {
    int hit = 0, blow = 0;
    for (int i = 0; i < 4; i++) {
      for (int j = 0; j < 4; j++) {
        if (a.at(i) == b.at(j)) {
          if (i == j) {
            hit++;
          } else {
            blow++;
          }
        }
      }
    }
    cout << hit << " " << blow << endl;
  }
}

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

int main(){
    int a[4], b[4];
    while(cin >> a[0] >> a[1] >> a[2] >> a[3]
              >> b[0] >> b[1] >> b[2] >> b[3] ){
        int hit = 0, blow = 0;
        for(int i = 0; i < 4; i++){
            for(int j = 0; j < 4; j++){
                if(a[i] == b[j]){
                    if(i == j){
                        hit++;
                    }else{
                        blow++;
                    }
                }
            }
        }
        cout << hit << ' ' << blow << endl;
    }
    return 0;
}

C++: #include<stdio.h>
int main(void){
int a[4],b[4];
while(~scanf("%d",a)){
int h=0,l=0;
for(int i=0;i<3;)scanf("%d",++i+a);
for(int i=0;i<4;)scanf("%d",b+i++);
for(int i=0;i<4;i++)for(int j=0;j<4;j++){
if(a[i]==b[j])if(i==j)h++;else l++;
}
printf("%d %d\n",h,l);
}
return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
  int a[4],b[4],i,j;
  while(cin>>a[0]){
    int c,d;
    for(i=1;i<4;i++)cin>>a[i];
    for(c=d=i=0;i<4;i++)cin>>b[i];
    for(i=0;i<4;i++)for(j=0;j<4;j++){
      if(a[i]==b[j]){
        if(i==j)c++;
        else d++;
      }
    }
    cout<<c<<' '<<d<<endl;
  }
}

C++: #include<iostream>
using namespace std;
int main(){
  int a[4],b[4], hit, blow;
  bool flag[4];
  while(cin >> a[0] >> a[1] >> a[2] >> a[3] >> b[0] >> b[1] >> b[2] >> b[3]){
    hit = 0; 
    blow = 0;
    for(int i=0; i<4; i++)
      flag[i] = false;

    for(int i=0; i<4; i++){
	if(a[i] == b[i]){
	  hit++;
	  flag[i] = true;
	}
	for(int j=0; j<4; j++){
	  if( a[i] == b[j] &&  flag[i] != true){
	    blow++;
	  }
	}
    }
    cout << hit << " " << blow << endl;
  }
}

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

const double EPS = 1.0e-6;
int main(){
	int a[4], b[4];
	while(cin>>a[0]>>a[1]>>a[2]>>a[3]>>b[0]>>b[1]>>b[2]>>b[3]){
		int hit = 0;
		int blow = 0;
		for(int i=0; i<4; i++){
			if(a[i]==b[i]) hit++;
			for(int j=0; j<4; j++){
				if(a[i]==b[j]) blow++;
			}
		}
		blow -= hit;
		cout<<hit<<" "<<blow<<endl;
	}
	return 0;
}

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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

#define MOD 1000000007
#define REP(i, N) for (int i = 0; i < N; ++i)
#define REP1(i, N) for (int i = 1; i <= N; ++i)
#define RREP(i, N) for (int i = N - 1; i >= 0; --i)
#define ALL(a) a.begin(), a.end()

int main() {
  while (true) {
    int n[2][4];
    REP(i, 2) REP(j, 4) {
      if (!(cin >> n[i][j])) return 0;
    }
    int a[10] = {};
    int b[10] = {};
    REP(i, 4) a[n[0][i]] = i + 1;
    REP(i, 4) b[n[1][i]] = i + 1;
    int hit = 0, blow = 0;
    REP(i, 10) {
      if (a[i] && b[i] && a[i] == b[i]) {
        hit++;
      } else if (a[i] && b[i] && a[i] != b[i]) {
        blow++;
      }
    }
    cout << hit << " " << blow << endl;
  }
  return 0;
}

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

int main()
{
	int a[4];
	int b[4];
	while (true)
	{
		for (int i = 0; i < 4; i++) cin >> a[i];
		for (int i = 0; i < 4; i++) cin >> b[i];
		if (a[0] == EOF) break;

		int hit = 0;
		int blow = 0;

		for (int i = 0; i < 4; i++)
		{
			for (int j = 0; j < 4; j++)
			{
				if (a[i] != b[j])
					continue;
				if (i == j)
					hit++;
				else
					blow++;
			}
		}
		cout << hit << ' ' << blow << endl;
	}
	return 0;
}