criyle/codenet-compile-errors huggingface dataset:
Language: C

#include <stdio.h>

int main(){
	int a[4], b[4], i, j;
	while(~scanf("%d %d %d %d\n%d %d %d %d\n", &a[0], &a[1], &a[2], &a[3], &b[0], &b[1], &b[2], &b[3])){
		int 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;
}

Compiler output:
main.c: In function 'main':
main.c:11:30: error: expected ';' before '}' token
   11 |                         hit++
      |                              ^
      |                              ;
   12 |                     }else{
      |                     ~
Language: C

#include <stdio.h>

int main(void)
{
	int a[4],b[4],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(i==j)
				{
					if(a[i]==b[j])
					{
						hit++;
					}
				}
				else
				{
					if(a[i]==b[j])
					{
						blow++;
					}
				}
			}
		}
		
		printf("%d %d\n"hit,blow);
	}
}

Compiler output:
main.c: In function 'main':
main.c:35:33: error: expected ')' before 'hit'
   35 |                 printf("%d %d\n"hit,blow);
      |                       ~         ^~~
      |                                 )
Language: C

#include <stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:35:33: error: expected ')' before 'hit'
   35 |                 printf("%d %d\n"hit,blow);
      |                       ~         ^~~
      |                                 )
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:6:12: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    6 |     while (scanf("%d %d %d %d",&array[0][0],&array[1][0],&array[2][0],&array[3][0])!=EOF){
      |            ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(){
main.c:6:12: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    6 |     while (scanf("%d %d %d %d",&array[0][0],&array[1][0],&array[2][0],&array[3][0])!=EOF){
      |            ^~~~~
main.c:6:12: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:6:86: error: 'EOF' undeclared (first use in this function)
    6 |     while (scanf("%d %d %d %d",&array[0][0],&array[1][0],&array[2][0],&array[3][0])!=EOF){
      |                                                                                      ^~~
main.c:6:86: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:6:86: note: each undeclared identifier is reported only once for each function it appears in
main.c:24:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   24 |         printf("%d %d\n",hit,blow);
      |         ^~~~~~
main.c:24:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:24:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:24:9: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

#include <iostream>
#include <array>
#include <algorithm>

int main(){

	int a1, a2, a3, a4, b1, b2, b3, b4;

	while(std::cin >> a1 >> a2 >> a3 >> a4){
		
		std::cin >> b1 >>b2 >> b3 >>b4;

		std::array<int> A_num = {a1, a2, a3, a4};
		std::array<int> B_num = {b1, b2, b3, b4};
		
		int hit = 0;
		int blow = 0;

		for(int i = 0; i < 4; ++i){
			
			if(A_num[i] == B_num[i])
				hit++;
				
			count += std::count(A_num.begin(), A_num.end(), B_num[i]);

		}

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

		return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:31: error: wrong number of template arguments (1, should be 2)
   13 |                 std::array<int> A_num = {a1, a2, a3, a4};
      |                               ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:99:12: note: provided for 'template<class _Tp, long unsigned int _Nm> struct std::array'
   99 |     struct array;
      |            ^~~~~
a.cc:13:33: error: scalar object 'A_num' requires one element in initializer
   13 |                 std::array<int> A_num = {a1, a2, a3, a4};
      |                                 ^~~~~
a.cc:14:31: error: wrong number of template arguments (1, should be 2)
   14 |                 std::array<int> B_num = {b1, b2, b3, b4};
      |                               ^
/usr/include/c++/14/bits/stl_pair.h:99:12: note: provided for 'template<class _Tp, long unsigned int _Nm> struct std::array'
   99 |     struct array;
      |            ^~~~~
a.cc:14:33: error: scalar object 'B_num' requires one element in initializer
   14 |                 std::array<int> B_num = {b1, b2, b3, b4};
      |                                 ^~~~~
a.cc:24:25: error: 'count' was not declared in this scope; did you mean 'std::count'?
   24 |                         count += std::count(A_num.begin(), A_num.end(), B_num[i]);
      |                         ^~~~~
      |                         std::count
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:3:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: 'std::count' declared here
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
Language: C++

#include <iostream>
#include <array>
#include <algorithm>

int main(){

	int a1, a2, a3, a4, b1, b2, b3, b4;

	while(std::cin >> a1 >> a2 >> a3 >> a4){
		
		std::cin >> b1 >>b2 >> b3 >>b4;

		std::array<int> A = {a1, a2, a3, a4};
		std::array<int> B = {b1, b2, b3, b4};
		
		int hit = 0;
		int blow = 0;

		for(int i = 0; i < 4; ++i){
			
			if(A[i] == B[i])
				hit++;
				
			count += std::count(A.begin(), A.end(), B[i]);

		}

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

		return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:31: error: wrong number of template arguments (1, should be 2)
   13 |                 std::array<int> A = {a1, a2, a3, a4};
      |                               ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:99:12: note: provided for 'template<class _Tp, long unsigned int _Nm> struct std::array'
   99 |     struct array;
      |            ^~~~~
a.cc:13:33: error: scalar object 'A' requires one element in initializer
   13 |                 std::array<int> A = {a1, a2, a3, a4};
      |                                 ^
a.cc:14:31: error: wrong number of template arguments (1, should be 2)
   14 |                 std::array<int> B = {b1, b2, b3, b4};
      |                               ^
/usr/include/c++/14/bits/stl_pair.h:99:12: note: provided for 'template<class _Tp, long unsigned int _Nm> struct std::array'
   99 |     struct array;
      |            ^~~~~
a.cc:14:33: error: scalar object 'B' requires one element in initializer
   14 |                 std::array<int> B = {b1, b2, b3, b4};
      |                                 ^
a.cc:24:25: error: 'count' was not declared in this scope; did you mean 'std::count'?
   24 |                         count += std::count(A.begin(), A.end(), B[i]);
      |                         ^~~~~
      |                         std::count
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:3:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: 'std::count' declared here
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
Language: C++

#include <iostream>
#include <array>
#include <algorithm>

int main(){

	int a1, a2, a3, a4, b1, b2, b3, b4;

	while(std::cin >> a1 >> a2 >> a3 >> a4){
		
		std::cin >> b1 >>b2 >> b3 >>b4;

		std::array<int, 4> A = {a1, a2, a3, a4};
		std::array<int, 4> B = {b1, b2, b3, b4};
		
		int hit = 0;
		int blow = 0;

		for(int i = 0; i < 4; ++i){
			
			if(A[i] == B[i])
				++hit;
				
			count += std::count(A.begin(), A.end(), B[i]);

		}

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

		return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:25: error: 'count' was not declared in this scope; did you mean 'std::count'?
   24 |                         count += std::count(A.begin(), A.end(), B[i]);
      |                         ^~~~~
      |                         std::count
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:3:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: 'std::count' declared here
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
 
int main(){
    std::vector<int> a(4);
     
    while(std::cin >> a[0] >> a[1] >> a[2] >> a[3]){
        int hit = 0, blow = 0;
         
        for(int i = 0; i < 4; ++i){
            int b;
            std::cin >> b;
             
            auto it = std::find(a.begin(), a.end(), b);
            if(it == a.begin() + i) ++hit;
            else if(it != a.end()) ++blow;
        }
         
        std::cout << hit << " " << blow << std::endl;
         
    }
     
    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:24:14: error: expected '}' at end of input
   24 |     return 0;
      |              ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

import java.io.IOException;
import java.util.Scanner;

class Main {

	public static void main(String[] args) throws IOException {

		Scanner sc = null;

		try {

			sc = new Scanner(System.in);
			int countHit=0;
			int countBlow=0;

			while (sc.hasNext()) {
				

				String[] a = sc.nextLine().split(" ");
				String[] b = sc.nextLine().split(" ");

				for (int i = 0; i < a.length; i++) {
					for(int j =0; j<b.length;j++){

						if (a[i] .equals(b[i])) {
							countHit++;
							break;
						}
						else if(a[i].equals(b[j])){

							countBlow++;
						}
					}
				}

				System.out.println(countHit+" "+countBlow);

			}

		} finally {
			sc.close();
		}

	}

}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.IOException;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.Scanner;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:15: error: expected ':' before 'static'
    6 |         public static void main(String[] args) throws IOException {
      |               ^~~~~~~
      |               :
a.cc:6:33: error: 'String' has not been declared
    6 |         public static void main(String[] args) throws IOException {
      |                                 ^~~~~~
a.cc:6:42: error: expected ',' or '...' before 'args'
    6 |         public static void main(String[] args) throws IOException {
      |                                          ^~~~
a.cc:6:46: error: expected ';' at end of member declaration
    6 |         public static void main(String[] args) throws IOException {
      |                                              ^
      |                                               ;
a.cc:6:48: error: 'throws' does not name a type
    6 |         public static void main(String[] args) throws IOException {
      |                                                ^~~~~~
a.cc:46:2: error: expected ';' after class definition
   46 | }
      |  ^
      |  ;
Language: C++

#include <stdio.h>

int main(void){
	int a[4],b[4],n,t,r,i,c,d;
	for(r=0,r<2;r++){
		c=0;
		d=0;
		for(t=0;t<4;t++){
				scanf("%d",&a[t]);
		}
		for(t=0;t<4;t++){
				scanf("%d",&b[t]);
		}
				
		for(t=0;t<4;t++){
			for(i=0;i<4;i++){
				if(b[t]==a[i]){
					c++;
				}
			}
		}
		for(i=0;i<4;i++){
			if(b[i]==a[i]){
				d++;
			}
		}
		printf("%d %d\n",d,c-d);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:24: error: expected ';' before ')' token
    5 |         for(r=0,r<2;r++){
      |                        ^
      |                        ;
Language: C++

import Control.Monad
import Control.Applicative
import Data.List

main = do
  xs <- input $ map read . words :: IO [[Int]]
  mapM_ putStrLn $ solve xs
  
solve :: [[Int]] -> [String]
solve [] = []
solve (xs:ys:yss) = (show h ++ " " ++ show b) : solve yss
  where h = hit xs ys
        b = smn xs ys - h

hit :: [Int] -> [Int] -> Int
hit xs ys = sum $ zipWith (\x y -> if x == y then 1 else 0) xs ys

smn :: [Int] -> [Int] -> Int
smn xs ys = foldl f 0 ys
  where
    f :: Int -> Int -> Int
    f acc z = if z `elem` xs then acc + 1 else acc

input :: (String -> a) -> IO [a]
input f = map f . lines <$> getContents 

Compiler output:
a.cc:16:28: error: stray '\' in program
   16 | hit xs ys = sum $ zipWith (\x y -> if x == y then 1 else 0) xs ys
      |                            ^
a.cc:22:20: error: stray '`' in program
   22 |     f acc z = if z `elem` xs then acc + 1 else acc
      |                    ^
a.cc:22:25: error: stray '`' in program
   22 |     f acc z = if z `elem` xs then acc + 1 else acc
      |                         ^
a.cc:1:1: error: 'import' does not name a type
    1 | import Control.Monad
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<iostream>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:20:46: error: expected primary-expression before ')' token
   20 |                                         else(){
      |                                              ^
Language: C++

def hit_blow(arr1, arr2)
  n, m = 0, 0
  
  4.times do |i|
    n += 1 if arr1[i] == arr2[i]
    m += 1 if arr1.include?(arr2[i]) 
  end
  
  return [n, m - n]
end

while gets
  arr1, arr2 = $_.split, gets.split
  h, b = hit_blow(arr1, arr2)
  puts "#{h} #{b}"
end

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def hit_blow(arr1, arr2)
      | ^~~
Language: C++

while gets
	a=$<.split.map(&:to_i)
	b=gets.split.map(&:to_i)
	c,d=0,0;
	4.times do |i|
		if a[i]==b[i] then
			c+=1
		else
			4.times do |j|
				if a[i]==b[j] then
					d+=1;break;
				end
			end
		end
	end
	print c," ",d,"\n"
end

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'while'
    1 | while gets
      | ^~~~~
a.cc:5:9: error: expected unqualified-id before numeric constant
    5 |         4.times do |i|
      |         ^~~~~~~
a.cc:11:46: error: expected unqualified-id before 'break'
   11 |                                         d+=1;break;
      |                                              ^~~~~
a.cc:12:33: error: 'end' does not name a type
   12 |                                 end
      |                                 ^~~
Language: C++

while gets
a=$_.split.map(&:to_i)
b=gets.split.map(&:to_i)
c,d=0,0;
4.times{|i|
if a[i]==b[i] then
c+=1
else
d+=1 if b.find{|j|j==a[i]}
end
}
print c," ",d,"\n"
end

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'while'
    1 | while gets
      | ^~~~~
a.cc:5:1: error: expected unqualified-id before numeric constant
    5 | 4.times{|i|
      | ^~~~~~~
a.cc:12:1: error: 'print' does not name a type; did you mean 'int'?
   12 | print c," ",d,"\n"
      | ^~~~~
      | int
Language: C++

#include<iostream>
using namespace std;

int main(){
  int a[4],c[4];
  while(1){
    int e=0,b=0,k;
    for(int i=0;i<4;i++)
      k=cin >> a[i];
    if(!k)break;
    if(a[i]==-1)break;
    for(int i=0;i<4;i++){
      cin >> c[i];
      for(int j=0;j<4;j++)
	if(c[i]==a[j]){
	  if(i==j)e++;
	  else b++;
	}
    }
    cout<<e<<' '<<b<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: cannot convert 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int' in assignment
    9 |       k=cin >> a[i];
      |         ~~~~^~~~~~~
      |             |
      |             std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
a.cc:11:10: error: 'i' was not declared in this scope
   11 |     if(a[i]==-1)break;
      |          ^
Language: C++

#include<iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: cannot convert 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int' in assignment
    9 |       k=cin >> a[i];
      |         ~~~~^~~~~~~
      |             |
      |             std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
Language: C++

#include <iostream>

using namespace std;

int main(){
	int a[4];
	int b[4];
	int h=0;
	int b=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){
				h = h+1;
			}
			else if(a[m] == b[n]){
				b = b+1;
			}
		}
		
	cout << h << " " << b << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: conflicting declaration 'int b'
    9 |         int b=0;
      |             ^
a.cc:7:13: note: previous declaration as 'int b [4]'
    7 |         int b[4];
      |             ^
a.cc:24:35: error: incompatible types in assignment of 'int*' to 'int [4]'
   24 |                                 b = b+1;
      |                                 ~~^~~~~
a.cc:29:2: error: expected '}' at end of input
   29 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: 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;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:2: error: expected '}' at end of input
   30 | }
      |  ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

#include<vector>
#include<iostream>
using namespace std;
int main() {
	int code[4], line, hit, bro;
	while (true) {
		hit = 0;
		bro = 0;
		for (int i = 0; i < 4; ++i) {
			cin >> code[i];
		}#include<vector>
#include<iostream>
using namespace std;
int main() {
	int code[4], line, hit, bro;
	while (cin>>code[0]) {
		hit = 0;
		bro = 0;
		for (int i = 1; i < 4; ++i) {
			cin >> code[i];
		}
		for (int i = 0; i < 4; ++i) {
			cin >> line;
			if (code[i] == line) {
				++hit;
			}
			else {
				for (int i2 = 0; i2 < 4; ++i2) {
					if (code[i2] == line) {
						++bro;
					}
				}
			}
		}
		cout << hit << " " << bro << endl;
	}
	return 0;
}
		for (int i = 0; i < 4; ++i) {
			cin >> line;
			if (code[i] == line) {
				++hit;
			}
			else {
				for (int i2 = 0; i2 < 4; ++i2) {
					if (code[i2] == line) {
						++bro;
					}
				}
			}
		}
		cout << hit << " " << bro << endl;
	}
	return 0;
}

Compiler output:
a.cc:11:18: error: stray '#' in program
   11 |                 }#include<vector>
      |                  ^
a.cc: In function 'int main()':
a.cc:11:19: error: 'include' was not declared in this scope
   11 |                 }#include<vector>
      |                   ^~~~~~~
a.cc:11:33: error: missing template arguments before '>' token
   11 |                 }#include<vector>
      |                                 ^
a.cc:13:1: error: expected primary-expression before 'using'
   13 | using namespace std;
      | ^~~~~
a.cc:14:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   14 | int main() {
      |         ^~
a.cc:14:9: note: remove parentheses to default-initialize a variable
   14 | int main() {
      |         ^~
      |         --
a.cc:14:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:14:12: error: a function-definition is not allowed here before '{' token
   14 | int main() {
      |            ^
Language: C++

int main()
{
    int hit[4]={},blow[4]={};
    while(cin>>hit[0]){
        int ans1=0,ans2=0;
        for(int i=1; i<4; i++){
            cin>>hit[i];
        }
        for(int i=0; i<4; i++){
            cin>>blow[i];
        }
        for(int i=0; i<4; i++){
            for(int j=0; j<4; j++){
                if(hit[i]==blow[j]){
                    (i==j)?ans1++:ans2++;
                }
            }
        }
        cout<<ans1<<" "<<ans2<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:11: error: 'cin' was not declared in this scope
    4 |     while(cin>>hit[0]){
      |           ^~~
a.cc:19:9: error: 'cout' was not declared in this scope
   19 |         cout<<ans1<<" "<<ans2<<endl;
      |         ^~~~
a.cc:19:32: error: 'endl' was not declared in this scope
   19 |         cout<<ans1<<" "<<ans2<<endl;
      |                                ^~~~
Language: C++

#include<iostream>
int main()
{
    int hit[4]={},blow[4]={};
    while(cin>>hit[0]){
        int ans1=0,ans2=0;
        for(int i=1; i<4; i++){
            cin>>hit[i];
        }
        for(int i=0; i<4; i++){
            cin>>blow[i];
        }
        for(int i=0; i<4; i++){
            for(int j=0; j<4; j++){
                if(hit[i]==blow[j]){
                    (i==j)?ans1++:ans2++;
                }
            }
        }
        cout<<ans1<<" "<<ans2<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |     while(cin>>hit[0]){
      |           ^~~
      |           std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:20:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 |         cout<<ans1<<" "<<ans2<<endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:20:32: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   20 |         cout<<ans1<<" "<<ans2<<endl;
      |                                ^~~~
      |                                std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
using namespace std;
int main(){

  int a[4],b[4],n,m;

  while(cin >> a[0]){
    n = 0;
    m = 0;
    cin >> a[1] >> a[2] >> a[3];
    for(int i=0;i<4;i++){
      cin >> b[i];
      if(a[i] == b[i]) n++;
    }
    sort(a,a+4);
    for(int i=0;i<4;i++){
      if(*lower_bound(a,a+4,b[i])==b[i]) m++;
    }
    cout << n << " " << (m-n) << endl;
  }
  return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   15 |     sort(a,a+4);
      |     ^~~~
      |     short
Language: C++

#include <iostream>
#include <array>

int main(){

	std::array<int,4> num_a, num;

	std::cin >> num_a[0] >> num_a[1] >> num_a[2] >> num_a[3];

	while(std::cin >> num[0] >> num[1] >> num[2] >> num[3]){
		int hit = 0, blow = 0;
		for(size_t i = 0; i < 4; ++i){
			if(num_a[i] == num[i]){
				++hit;
			}else{
				for(size_t j = 0; j < 4; ++j){
					if(num_a[j] == num[i]){
						++blow;
					}
				}
			}
		}
		std::out << hit << " " << blow << std::endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:22: error: 'out' is not a member of 'std'; did you mean 'oct'?
   23 |                 std::out << hit << " " << blow << std::endl;
      |                      ^~~
      |                      oct
Language: C++

#include<iostream>
#include<vector>
using namespace std;

void get(int* nums_a,int* nums_b){
  int nums_a[4];
  int nums_b[4];
  for(int i=0;i<4;i++){
    cin>>nums_a[i];
  }
  for(int i=0;i<4;i++){
    cin>>nums_b[i];
  }
}

int main(){
  vector<int> hit_anss;
  vector<int> bolor_anss;
  int hit=0,bolor=0;
  while(get(nums_a,nums_b)){
    //hit????¢????
    for(int i=0;i<4;i++){
      if(nums_a[i]==nums_b[i])hit++;
    }
    //bolor????¢????
    for(int i=0;i<4;i++){
      for(int j=0;j<4;j++){
        if(i==j)continue;
        if(nums_a[i]==nums_b[j]){
          bolor++;
          break;
        }
      }
    }
    hit_anss.push_back(hit);
    bolor_anss.push_back(bolor);
  }
  for(int i=0;i<hit_anss.size();i++){
    cout<<hit_anss[i]<<' '<<bolor_anss[i]<<endl;
  }
}

Compiler output:
a.cc: In function 'void get(int*, int*)':
a.cc:6:7: error: declaration of 'int nums_a [4]' shadows a parameter
    6 |   int nums_a[4];
      |       ^~~~~~
a.cc:5:15: note: 'int* nums_a' previously declared here
    5 | void get(int* nums_a,int* nums_b){
      |          ~~~~~^~~~~~
a.cc:7:7: error: declaration of 'int nums_b [4]' shadows a parameter
    7 |   int nums_b[4];
      |       ^~~~~~
a.cc:5:27: note: 'int* nums_b' previously declared here
    5 | void get(int* nums_a,int* nums_b){
      |                      ~~~~~^~~~~~
a.cc: In function 'int main()':
a.cc:20:13: error: 'nums_a' was not declared in this scope
   20 |   while(get(nums_a,nums_b)){
      |             ^~~~~~
a.cc:20:20: error: 'nums_b' was not declared in this scope
   20 |   while(get(nums_a,nums_b)){
      |                    ^~~~~~
Language: 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} 
        if (b==f){x=x+1} 
        if (c==g){x=x+1}
        if (d==h){x=x+1}
        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 ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: expected ';' before '}' token
    8 |         if (a==e){x=x+1}
      |                        ^
      |                        ;
a.cc:9:24: error: expected ';' before '}' token
    9 |         if (b==f){x=x+1}
      |                        ^
      |                        ;
a.cc:10:24: error: expected ';' before '}' token
   10 |         if (c==g){x=x+1}
      |                        ^
      |                        ;
a.cc:11:24: error: expected ';' before '}' token
   11 |         if (d==h){x=x+1}
      |                        ^
      |                        ;
Language: 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 ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:31: error: expected ';' before '}' token
    8 |         if (a==e){x=x+1;e=e+10}
      |                               ^
      |                               ;
a.cc:9:31: error: expected ';' before '}' token
    9 |         if (b==f){x=x+1;f=f+10}
      |                               ^
      |                               ;
a.cc:10:31: error: expected ';' before '}' token
   10 |         if (c==g){x=x+1;g=g+10}
      |                               ^
      |                               ;
a.cc:11:31: error: expected ';' before '}' token
   11 |         if (d==h){x=x+1;h=h+10}
      |                               ^
      |                               ;
Language: C++

#include <iostream>

int main(){
	std::array(u_int, 4) a, b;
	int hit=0, blow=0;

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

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:19: error: missing template arguments before '(' token
    4 |         std::array(u_int, 4) a, b;
      |                   ^
a.cc:4:25: error: expected primary-expression before ',' token
    4 |         std::array(u_int, 4) a, b;
      |                         ^
a.cc:7:15: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |         while(cin >> a[0] >> a[1] >> a[2] >> a[3]){
      |               ^~~
      |               std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:22: error: 'a' was not declared in this scope
    7 |         while(cin >> a[0] >> a[1] >> a[2] >> a[3]){
      |                      ^
a.cc:8:24: error: 'b' was not declared in this scope
    8 |                 cin >> b[0] >> b[1] >> b[2] >> b[3];
      |                        ^
a.cc:15:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |                 cout << hit << blow-hit << std::endl;
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <iostream>
#include <array>

int main(){
	std::array(u_int, 4) a, b;
	int hit=0, blow=0;

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

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:19: error: missing template arguments before '(' token
    5 |         std::array(u_int, 4) a, b;
      |                   ^
a.cc:5:25: error: expected primary-expression before ',' token
    5 |         std::array(u_int, 4) a, b;
      |                         ^
a.cc:8:15: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |         while(cin >> a[0] >> a[1] >> a[2] >> a[3]){
      |               ^~~
      |               std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:22: error: 'a' was not declared in this scope
    8 |         while(cin >> a[0] >> a[1] >> a[2] >> a[3]){
      |                      ^
a.cc:9:24: error: 'b' was not declared in this scope
    9 |                 cin >> b[0] >> b[1] >> b[2] >> b[3];
      |                        ^
a.cc:16:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |                 cout << hit << blow-hit << std::endl;
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <iostream>
#include <array>

int main(){
	std::array(u_int, 4) a;
	std::array(u_int, 4) b;
	int hit=0, blow=0;

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

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:19: error: missing template arguments before '(' token
    5 |         std::array(u_int, 4) a;
      |                   ^
a.cc:5:25: error: expected primary-expression before ',' token
    5 |         std::array(u_int, 4) a;
      |                         ^
a.cc:6:19: error: missing template arguments before '(' token
    6 |         std::array(u_int, 4) b;
      |                   ^
a.cc:6:25: error: expected primary-expression before ',' token
    6 |         std::array(u_int, 4) b;
      |                         ^
a.cc:9:15: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |         while(cin >> a[0] >> a[1] >> a[2] >> a[3]){
      |               ^~~
      |               std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:22: error: 'a' was not declared in this scope
    9 |         while(cin >> a[0] >> a[1] >> a[2] >> a[3]){
      |                      ^
a.cc:10:24: error: 'b' was not declared in this scope
   10 |                 cin >> b[0] >> b[1] >> b[2] >> b[3];
      |                        ^
a.cc:17:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   17 |                 cout << hit << blow-hit << std::endl;
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <iostream>
#include <array>

int main(){
	std::array(u_int, 4) a,b;
	int hit=0, blow=0;

	while(std::cin >> a[0] >> a[1] >> a[2] >> a[3]){
		std::cin >> b[0] >> b[1] >> b[2] >> b[3];
		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++;
			}
		}
		std::cout << hit << blow-hit << std::endl;
	}

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:19: error: missing template arguments before '(' token
    5 |         std::array(u_int, 4) a,b;
      |                   ^
a.cc:5:25: error: expected primary-expression before ',' token
    5 |         std::array(u_int, 4) a,b;
      |                         ^
a.cc:8:27: error: 'a' was not declared in this scope
    8 |         while(std::cin >> a[0] >> a[1] >> a[2] >> a[3]){
      |                           ^
a.cc:9:29: error: 'b' was not declared in this scope
    9 |                 std::cin >> b[0] >> b[1] >> b[2] >> b[3];
      |                             ^
Language: C++

#include <iostream>

using namespace std;

int main() {
  int a[4], b, hit, blow, i, j;
  while (cin >> a[0]) {
    h = 0, blow = 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[j] == b) {
	  if (i == j) {
	    hit++;
	  }
	  else {
	    blow++;
	  }
	}
      }
    }
    cout << hit << ' ' << blow << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'h' was not declared in this scope
    8 |     h = 0, blow = 0;
      |     ^
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
int main(){
 int a[4],b[4],h,bb,i;
 while(cin>>a[0]>>a[1]>>a[2]>>a[3]>>b[0]>>b[1]>>b[2]>>b[3]){
  h=bb=0
  for(i=0;i<4;i++)if(a[i]==b[i])h++;
  sort(a,a+4);sort(b,b+4);
  for(i=0;i<4;i++)if(find(b,b+4,a[i])!=b+4)bb++;
  bb -= h;
  cout<<h<<" "<< bb << endl;
 }
 zreturn 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: expected ';' before 'for'
    7 |   h=bb=0
      |         ^
      |         ;
    8 |   for(i=0;i<4;i++)if(a[i]==b[i])h++;
      |   ~~~    
a.cc:8:18: error: expected ';' before ')' token
    8 |   for(i=0;i<4;i++)if(a[i]==b[i])h++;
      |                  ^
      |                  ;
a.cc:14:2: error: 'zreturn' was not declared in this scope
   14 |  zreturn 0;
      |  ^~~~~~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
	vector<int> a(4);
	while(cin>>a[0]>>a[1]>>a[2]>>a[3]){
		vector<int> b(4);
		cin>>b[0]>>b[1]>>b[2]>>b[3];
		int h=0,bl=0;
		for(int i=0;i<4;++i){
			if(b[i]==a[i]) ++h;
			else if(find(a.begin(),a.end(),b[i])!=a.end()) ++bl;
		}
		cout << h << " " << bl << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:37: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   12 |                         else if(find(a.begin(),a.end(),b[i])!=a.end()) ++bl;
      |                                 ~~~~^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:12:37: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   12 |                         else if(find(a.begin(),a.end(),b[i])!=a.end()) ++bl;
      |                                 ~~~~^~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
    int a[4];
    int b[4];

    while(1){
        int hit = 0;
        int blow = 0;

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

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

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:23: error: 'hit' was not declared in this scope
   25 |     printf("%d %d\n", hit, blow);
      |                       ^~~
a.cc:25:28: error: 'blow' was not declared in this scope
   25 |     printf("%d %d\n", hit, blow);
      |                            ^~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;

int main() {
  vector<int> a(4), 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, blow = 0;
    for (int i = 0; i < 4; i++) {
      if (find(b.begin(), b.end(), a[i]) != b.end()) {
        if (a[i] == b[i]) hit++;
        else blow++;
      }
    }
    cout << hit << " " << blow << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   12 |       if (find(b.begin(), b.end(), a[i]) != b.end()) {
      |           ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:12:15: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   12 |       if (find(b.begin(), b.end(), a[i]) != b.end()) {
      |           ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <stdio.h>
  int main(){ 
	  int a[5],b[5],i,j;
	  int hit=0,blow=0;
	  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){
		  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(j != i){
				  if(a[i]==b[j]){
					  blow++;
				  }	  
			  }
		  }
		  printf("%d %d\n",hit,blow);
		  hit=0; blow=0;
	  }
	  return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:23:4: error: expected '}' at end of input
   23 |   }
      |    ^
a.cc:2:13: note: to match this '{'
    2 |   int main(){
      |             ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

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

     

Compiler output:
a.cc: In function 'int main()':
a.cc:30:10: error: 'hit' was not declared in this scope
   30 |    cout<<hit<<" "<<blow<<endl;
      |          ^~~
a.cc:30:20: error: 'blow' was not declared in this scope
   30 |    cout<<hit<<" "<<blow<<endl;
      |                    ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

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

     

Compiler output:
a.cc: In function 'int main()':
a.cc:31:10: error: 'hit' was not declared in this scope
   31 |    cout<<hit<<" "<<blow<<endl;
      |          ^~~
a.cc:31:20: error: 'blow' was not declared in this scope
   31 |    cout<<hit<<" "<<blow<<endl;
      |                    ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

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

     

Compiler output:
a.cc: In function 'int main()':
a.cc:22:6: error: expected '}' before 'else'
   22 |      else
      |      ^~~~
a.cc:20:6: note: to match this '{'
   20 |      {
      |      ^
a.cc:32:10: error: 'hit' was not declared in this scope
   32 |    cout<<hit<<" "<<blow<<endl;
      |          ^~~
a.cc:32:20: error: 'blow' was not declared in this scope
   32 |    cout<<hit<<" "<<blow<<endl;
      |                    ^~~~
a.cc: At global scope:
a.cc:34:4: error: expected unqualified-id before 'return'
   34 |    return 0;
      |    ^~~~~~
a.cc:35:1: error: expected declaration before '}' token
   35 | }
      | ^