Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>
#include <string>
#include <queue>
#include <algorithm>
#include <cctype>
#define shosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const double pi=acos(-1);

vector<char> a(4),b(4);

int main(){
	char c,d,e,f;
	while(cin>>c>>d>>e>>f>>g>>h>>d>>k){
		int hit=0,blow=0;
		a={c,d,e,f};
		b={g,h,d,k};
//		for(int i=0;i<4;i++) cin>>b[i];
		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) continue;
				if(a[i]==b[j]) blow++;
			}
		}
		cout<<hit<<' '<<blow<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:32: error: 'g' was not declared in this scope
   26 |         while(cin>>c>>d>>e>>f>>g>>h>>d>>k){
      |                                ^
a.cc:26:35: error: 'h' was not declared in this scope
   26 |         while(cin>>c>>d>>e>>f>>g>>h>>d>>k){
      |                                   ^
a.cc:26:41: error: 'k' was not declared in this scope
   26 |         while(cin>>c>>d>>e>>f>>g>>h>>d>>k){
      |                                         ^
a.cc:29:27: error: no match for 'operator=' (operand types are 'std::vector<char>' and '<brace-enclosed initializer list>')
   29 |                 b={g,h,d,k};
      |                           ^
In file included from /usr/include/c++/14/vector:72,
                 from a.cc:2:
/usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = char; _Alloc = std::allocator<char>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::vector<char>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66:
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = char; _Alloc = std::allocator<char>]'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<char>&&'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = char; _Alloc = std::allocator<char>]'
  788 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::initializer_list<char>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~