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>
using namespace std;
#define rep2(x,from,to) for(int x=(from); x<(to); (x)++)
#define rep(x,to) rep2(x,0,to)
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;
		rep(i,4) {
			rep(j,4) {
				if(a[i] == b[j]) {
					if(i == j) hit++;
					else blow++;
				}
			}
		}
		cout << hit << " " << blow << endl;
	}
	return 0;
}

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

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

		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;
}

C++: #include <stdio.h>

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

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

int main(){
  for (int k = 0; k < 50; k++) {
    vector<int> a(4), b(4);
    for (int i = 0; i < 4; i++) {
      cin >> a.at(i);
    }
    for (int i = 0; i < 4; i++) {
      cin >> b.at(i);
    }
    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>
int main()
{

	while (1) {
		int a[4], b[4];
		int eat = 0, bite = 0;
		for (int i = 0; i < 4; i++) {
			std::cin >> a[i];
		}
		for (int i = 0; i < 4; i++) {
			std::cin >> b[i];
		}
		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 4; j++) {
				if (i == j&&a[i] == b[j]) {
					eat++;
				}
				else if (a[i] == b[j]) {
					bite++;
				}
			}
		}
		std::cout << eat << " " << bite << std::endl;
	}
	return 0;
}

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

int main(){
  for (;;) {
    vector<int> a(4), b(4);
    for (int i = 0; i < 4; i++) {
      cin >> a.at(i);
    }
    for (int i = 0; i < 4; i++) {
      cin >> b.at(i);
    }
    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][2],b[4][2];
	while(cin >>a[0][0]>>a[1][0]>>a[2][0]>>a[3][0]){
		cin >>b[0][0]>>b[1][0]>>b[2][0]>>b[3][0];
		a[0][1] = a[1][1] = a[2][1] = a[3][1] = b[0][1] = b[1][1] = b[2][1] = b[3][1] = 1;
		int hit = 0,blow = 0;
		for(int i=0; i<4; i++){
			if(a[i][0] == b[i][0]){
				a[i][1] = 0;
				b[i][1] = 0;
				hit++;
			}
		}
		for(int i=0; i<4; i++){
			for(int l=0; l<4; l++){
				if(a[i][1] == 1 && b[l][1] == 1 && a[i][0] == b[l][0]){
					a[i][1] = 0;
					b[l][1] = 0;
					blow++;
				}
			}
		}
		cout<<hit<<" "<<blow<<endl;
	}
}

C++: #include <iostream>

using namespace std;

int main()
{
	int i, j;
	int hit, blow;
	int numa[4];
	int numb[4];
	
	while(1)
	{
		if (cin.eof())
		{
			break;
		}
		
		for(i = 0; i < 4; i++)
		{
			cin >> numa[i];
		}
		
		for(i = 0; i < 4; i++)
		{
			cin >> numb[i];
		}
		
		
		hit = 0;
		for(i = 0; i < 4; i++)
		{
			if(numa[i] == numb[i])
			{
				hit = hit + 1;
			}
		}
		blow = 0;
		for(i = 0; i < 4; i++)
		{
			for(j = 0; j < 4; j++)
			{
				if(numa[i] == numb[j] && i != j)
				{
					blow = blow + 1;
				}
			}
		}
		
		cout << hit << " " << blow << endl;
	}
		
	
	cout << hit << " " << blow << endl;
	return 0;
}

C++: #include<stdio.h>
 
int main(void){
	
	int a[5],b[5];
	int i,j,hit,brrow;
	double stoped;
	
	

		hit=0,brrow=0;
	
		for(i=0;i<4;i++){
			scanf("%d",&a[i]);
		}

		for(i=0;i<4;i++){
			scanf("%d",&b[i]);
		}

		for(i=0;i<4;i++){		//hit
			if(a[i]==b[i]){
				hit++;
			}
		}
	
		for(i=0;i<4;i++){		//brrow
			for(j=0;j<4;j++){
				if(a[i]==b[j] && i!=j){
					brrow++;
				}
			}
		}	
		printf("%d %d\n",hit,brrow);
	
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
    int a,b,c,d,e,f,g,h,x=0,y=0;
    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 <cstdio>
int main()
{
    int a[4], b[4];
    while (scanf("%d%d%d%d", a, a+1, a+2, a+3) != EOF) {
        scanf("%d%d%d%d", b, b+1, b+2, b+3);
        int c = 0, d = 0;
        for (int i = 0; i < 4; ++i) if (a[i] == b[i]) c++;
        for (int i = 0; i < 4; ++i)
            for (int j = 0; j < 4; ++j)
                if (i != j && a[i] == b[j]) d++;
        printf("%d %d\n", c, d);
    }
    return 0;
}

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

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