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;
    cin >> a >> b >> c >> d;
    cin >> e >> f >> g >> h;
        if (a==e){x++;e=e+10;} 
        if (b==f){x++;f=f+10;} 
        if (c==g){x++;g=g+10;}
        if (d==h){x++;h=h+10;}
        if (e==a||e==b||e==c||e==d){y++;}
        if (f==a||f==b||f==c||f==d){y++;}
        if (g==a||g==b||g==c||g==d){y++;}
        if (h==a||h==b||h==c||h==d){y++;}
        cout << x << y << endl;
    
    
return 0 ;
}

C++:  
 #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 
 using namespace std;
 
 double abs(double x)
 {
   if(x<0) return -x;
   else return x;       
 }
  
 int main()
 {
   int a[4],b[4];
   int hit,blow;
   while(cin>>a[0])
   {
     hit=blow=0;
     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++) if(a[i]==b[i]) hit++;
     sort(a,a+4);
     sort(b,b+4);
     for(int i=0;i<4;i++) if(a[i]==b[i]) blow++;
     blow-=hit;
     cout<<hit<<" "<<blow<<endl;
   }
   //while(1);      
   return 0;    
 }

C++: #include <iostream>
using namespace std;
int main(){
	int a[4],b[4];
	while(cin >> a[0]){
		int hit = 0,brow = 0;
		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]){
					i == j? hit++ : brow++;
				}
			}
		}
		cout << hit << " " << brow << endl;
	}
	return 0;
}

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

int main(){
	int num1,num2,num3,num4;
	while(std::cin >> num1 >> num2 >> num3 >> num4){
		//player A number
		std::array<int, 4> a_num = {{num1, num2, num3, num4}};
		std::cin >> num1 >> num2 >> num3 >> num4;
		//player B number
		std::array<int, 4> b_num = {{num1, num2, num3, num4}};
		
		int hit=0,blow=0;
		for(int i=0; i<4; ++i){
			for(int j=0; j<4; ++j){
				//equal numbers
				if(a_num[i] == b_num[j]){
					//same place number
					if(i == j){
						++hit;
					}
					//different place number
					else{
						++blow;
					}
				}
			}
		}
		//hit and blow output
		std::cout << hit << " " << blow << std::endl;
	}
}

C++: #include<iostream>
using namespace std;
int main(){
int a[4];
int b[4];
int hit,blow;
while(cin>>a[0]>>a[1]>>a[2]>>a[3]){
cin>>b[0]>>b[1]>>b[2]>>b[3];
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(a[i]==b[j])blow++;}}
blow-=hit;
cout<<hit<<" "<<blow<<endl;}}

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

int hit(std::vector<int> a, std::vector<int> b){
    int hit_count = 0;
    for(int i = 0; i < 4; ++i){
        if(a.at(i) == b.at(i)){
            hit_count += 1;
        }
    }
    return hit_count;
}

int same_number(std::vector<int> a, std::vector<int> b){
    int same_count = 0;
    for(int i = 0; i < 4; ++i){
        for(int j = 0; j < 4; ++j){
            if(a.at(i) == b.at(j)){
                same_count += 1;
            }
        }
    }
    return same_count;
}

int main(){
    std::vector<int> a_set, b_set;
    int a[4], b[4];
    while(std::cin >> a[0] >> a[1] >> a[2] >> a[3]){
        if(a[0] == -1 or a[1] == -1 or a[2] == -1 or a[3] == -1)  break;
        for(int i = 0; i < 4; ++i){
            a_set.push_back(a[i]);
        }
        std::cin >> b[0] >> b[1] >> b[2] >> b[3];
        if(b[0] == -1 or b[1] == -1 or b[2] == -1 or b[3] == -1)  break;
        for(int i = 0; i < 4; ++i){
            b_set.push_back(b[i]);
        }
        std::cout << hit(a_set, b_set) << " " << same_number(a_set, b_set) - hit(a_set, b_set) << std::endl;
        a_set.clear();
        b_set.clear();
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
    int a[4];
    int c[4];
    while(cin>>a[0]>>a[1]>>a[2]>>a[3]>>c[0]>>c[1]>>c[2]>>c[3]){
        int h=0,b=0;
        for(int i=0;i<4;i++){
            if(a[i]==c[i])
                h++;
            else{
                for(int j=0;j<4;j++){
                    if(a[i]==c[j]){
                        b++;
                        break;
                    }
                }
            }
        }
        cout<<h<<" "<<b<<endl;
    }
    return 0;
}

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

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

C++: #include <cstdio>

using namespace std;

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

C++: #include <iostream>

using namespace std;

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

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

using namespace std;

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

	for(int i=0; i<4; i++){
		cin >> a[i];
	}
	for(int i=0; i<4; i++){
		cin >> b[i];
	}
	for(m=0; m<4; m++){
		for(n=0; n<4; n++){
			if(a[m] == b[n] && m == n){
				hit = hit + 1;
			}
			else if(a[m] == b[n]){
				blow = blow + 1;
			}
		}
		
	cout << hit << " " << blow << endl;
}

C++: #include<iostream>

using namespace std;

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

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

int main()
{
cout<<"Accepted"<<endl;
return 0;
}

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

int main(void)
{
	int n, hit = 0 , blow = 0;
	int num1[4], num2[4];

	for(int f1 = 0; f1 < 4; f1++)
	{
		scanf("%d", &num1[f1]);
	}
	for(int f1 = 0; f1 < 4; f1++)
	{
		scanf("%d", &num2[f1]);
	}
	for(int f1 = 0; f1 < 4; f1++)
	{
		if(num1[f1] == num2[f1])
		{
			hit++;
		}
		else
		{
			for(int f2 = 0; f2 < 4; f2++)
			{
				if(num1[f1] == num2[f2])
				{
					blow++;
					break;
				}
			}
		}
	}
	printf("%d %d\n", hit, blow);
	return 0;
}

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

int main(){
  int a[4],b[4];
  int hit,blow;

  while(cin>>a[0]>>a[1]>>a[2]>>a[3]){
    cin>>b[0]>>b[1]>>b[2]>>b[3];
    hit = 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(a[i] == b[j])
	  blow++;

    blow -= hit;

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


  return 0;
}