Go: package main

import (
	"bufio"
	"os"
	"strings"
	"strconv"
	"fmt"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	a := make([]int, 4)
	b := make([]int ,4)
	for scanner.Scan() {
		inputa := strings.Split(scanner.Text(), " ")
		for i := range a {
			a[i], _ = strconv.Atoi(inputa[i])
		}
		scanner.Scan()
		inputb := strings.Split(scanner.Text(), " ")
		for i := range b {
			b[i], _ = strconv.Atoi(inputb[i])
		}
		hit := 0
		blow := 0
		if a[0] == b[0] {
			hit++
		}
		if a[1] == b[1] {
			hit++
		}
		if a[2] == b[2] {
			hit++
		}
		if a[3] == b[3] {
			hit++
		}
		if a[0] == b[1] {
			blow++
		}
		if a[1] == b[2] {
			blow++
		}
		if a[2] == b[3] {
			blow++
		}
		if a[1] == b[0] {
			blow++
		}
		if a[2] == b[1] {
			blow++
		}
		if a[2] == b[0] {
			blow++
		}
		if a[3] == b[2] {
			blow++
		}
		if a[3] == b[1] {
			blow++
		}
		if a[3] == b[0] {
			blow++
		}
		if a[0] == b[2] {
			blow++
		}
		if a[1] == b[3] {
			blow++
		}
		if a[0] == b[3] {
			blow++
		}
		fmt.Printf("%d %d\n", hit, blow)
	}
}

C++: #include<iostream>

int main(){
	int a[4],b[4],i,n,hit=0,blow=0;


	while(std::cin>>a[0]){

	for(i=0;i<4;i++){
		std::cin>>a[i];
	}
	
	std::cout<<std::endl;

	for(i=0;i<4;i++){
		std::cin>>b[i];
	}

	for(i=0;i<4;i++){
		for(n=0;n<4;n++){
			if(a[i]==b[n]){
				if(i==n){
					hit++;
				}
				else blow++;
			}
		}
	}

	std::cout<<hit<<" "<<blow<<std::endl;

	}
	
	return 0;



}

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

int main(){
	std::vector<int> a(4), b(4);
	int hit_num, blow_num;
	
	while(std::cin >> a[0] >> a[1] >> a[2] >> a[3]){
		std::cin >> b[0] >> b[1] >> b[2] >> b[3];
		hit_num = 0;
		blow_num = 0;
		
		for(int i = 0; i < 4; ++i){
			if(a[i] == b[i]) ++hit_num;
			blow_num += std::count(a.begin(), a.end(), b[i]);
		}
		
		blow_num -= hit_num;
		std::cout << hit_num << " " << blow_num << std::endl;
	}
}

C++: #include <iostream>

using namespace std;

int main()
{
	while(!cin.eof())
	{
		bool blowlist[10];
		for(auto& i : blowlist)
			i = false;

		int a[4];
		int b[4];
		for(auto& i : a)
		{
			cin >> i;
			blowlist[i] = true;
		}
		for(auto& i : b)
			cin >> i;

		int hit  = 0;
		int blow = 0;
		for(int i = 0; i < 4; i++)
		{
			if(a[i] == b[i])
				hit++;
			else if(blowlist[b[i]])
				blow++;
		}

		cout << hit << ' ' << blow << endl;
	}

	return 0;
}

C++: #include <iostream>

using namespace std;

int main(void) {
	while(1) {
		int nu1[4], nu2[4];
		int hit = 0, blow = 0;
		
		cin >> nu1[0];
		if( cin.eof() )		break;
		
		for(int i = 1; i < 4; i++)
			cin >> nu1[i];
		for(int i = 0; i < 4; i++)
			cin >> nu2[i];
		
		for(int i = 0; i < 4; i++) {
			/*HIT*/
			if(nu1[i] == nu2[i]) {
				hit++;
			}
			/*BLOW*/
			for(int j = 0; j < 4; j++) {
				if(nu1[i] == nu2[j]) {
					blow++;
					break;
				}
			}
		}
		
		cout << hit << ' ' << blow - hit << endl;
	}
	
	return 0;
}

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

int main()
{
 int a[4];

 while(cin >> a[0] >> a[1] >> a[2] >> a[3]){
  int hit = 0, blow = 0;
  for(int i=0; i<4; i++){
   int n;
   cin >> n;
   if(n == a[i]){
    hit++;
    continue;
   }
   for(int j=0; j<4; j++){
    if(n == a[j]){
     blow++;
     break;
    }
   }
  }
  cout << hit << ' ' << blow << '\n';
 }
 
 return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <cstring>
#include <climits>
#include <cmath>
#include <cfloat>

using namespace std;

int bucket[10];
int a[4], b, hit, blow;

int main()
{
	
	while(1)
	{
		
		memset(bucket, 0, sizeof(bucket));
		hit = 0; blow = 0;
		
		for(int i = 0; i < 4; i++)
		{
			cin >> a[i];
			
			if( cin.eof() )
				return 0;
			
			bucket[a[i]] = 1;
		}
		
		for(int i = 0; i < 4; i++)
		{
			cin >> b;
			if( b == a[i] )
				hit++;
			else if( bucket[b] )
				blow++;
		}
		
		cout << hit << " " << blow << endl;	
		
	}
	
	return 0;
}

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

int main(){
  int a[4],c[4];
  while(1){
    int e=0,b=0;
      for(int j=0;j<4;j++)
	cin >> c[j];

      for(int i=0;i<4;i++){
	cin >> a[i];
      for(int j=0;j<4;j++)
	if(a[i]==c[j]){
	  if(i==j)e++;
	  else b++;
	}
      }
    cout<<e<<' '<<b<<endl;
  }
  return 0;
}

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

int main()
{
	int Aslc[4] ;
	int Bslc[4] ;

	int hit = 0 ;
	int blow = 0 ;

	while( cin >> Aslc[0] >> Aslc[1] >> Aslc[2] >> Aslc[3] >> Bslc[0] >> Bslc[1] >> Bslc[2] >> Bslc[3] )
	{
		for( int i = 0 ; i < 4 ; i ++ )
		{
			for( int j = 0 ; j < 4 ; j ++ )
			{
				if( Aslc[i] == Bslc[j] )
				{
					if( i == j )
					{
						hit ++ ;
					}
					else
					{
						blow ++ ;
					}
				}
			}
		}

		cout << hit << " " << blow << endl ;
		hit = 0 ;
		blow = 0 ;
	}

	return 0 ;
}

C++: #include<stdio.h>
int a[4]={0};
int b[4]={0};
int hit=0,blow=0;

int main()
{
    while(scanf("%d",&a[0])!=-1)
    {
        for(int i=1;i<4;i++)
        {
            scanf("%d",&a[i]);
        }
        for(int i=0;i<4;i++)
        {
            scanf("%d",&b[i]);
        }
        for(int i=0;i<4;i++)
        {
            if(a[i]==b[i])
            {
                hit++;
                a[i]=10;
                b[i]=10;
            }
        }
        for(int i=0;i<4;i++)
        {
            if(b[i]!=10)
            {
                for(int j=0;j<4;j++)
                {
                    if(b[i]==a[j])
                    {
                        blow++;
                    }
                }
            }
        }
        printf("%d %d\n",hit,blow);
        for(int i=0;i<4;i++)
        {
            a[i]=0;
            b[i]=0;
        }
        hit=0;
        blow=0;
    }
    return 0;
}

C++: #include <iostream>

using namespace std;

int main(){

	int A[5];
	int B[5];

	while(cin >> A[0] >> A[1] >> A[2] >> A[3] >> B[0] >> B[1] >> B[2] >> B[3]){

		int hit = 0 , blow = 0;

		if(A[0] == 0 || A[1] == 0 || A[2] == 0 || A[3] == 0 ||
			B[0] == 0 || B[1] == 0 || B[2] == 0 || B[3] == 0) break;

		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] && A[i] != B[i]){
					blow++;
				}
			}
		}

		cout << hit << " " << blow << endl;
	}

	return 0;
}

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++){
      if(a[i]==b[i])
        hit++;
    }
    for(int i=0;i<4;i++){
      for(int j=0;j<4;j++){
        if(i==j);
        else{
          if(a[i]==b[j])
            blow++;
        }
      }
    }
  cout << hit << " " << blow << endl;  
  }
}

C++: #include <iostream>

using namespace std;

int main() {

	int A, a[4] = {}, b[4] = {};

	while (cin >> a[0]) {
		int hit = 0, blow = 0;
		if (cin.eof()) {
			break;
		}
		else {
			for (int i = 1; i < 4; i++) {
				cin >> a[i];
			}
			for (int i = 0; i < 4; i++) {
				cin >> b[i];
			}
			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 <iostream>

int main() {
	const int size = 4;
	int a[size], b[size];

	while (std::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 < size; i++)
			if (a[i] == b[i]) {
				hit++;
			} else {
				for (int j = 0; j < size; j++)
					if (i != j && a[i] == b[j])
						blow++;
			}

		std::cout << hit << " " << blow << std::endl;
	}
}