Language: C++

#include <iostream>
#include <vector>
using namespace std;
vector<int>prime;
int main(){
    int ask;
    prime.push_back(1);
    prime.push_back(2);
    for(int i=3;i<10001;i++){
        int t=1;
        for(int j=2;j*j<=i;j++){
            if(i%j==0){
                t=0;
                break;
            }
        }
        
        if(t)
            prime.push_back(i);
    }
    while(true){
        cin>>ask;
        if(ask==0)
            break;
        for(int i=ask;i>1;i--){
            if(find(prime.begin(),prime.end(),i)!=prime.end()&&find(prime.begin(),prime.end(),i-2)!=prime.end()){
                cout<<i-2<<" "<<i<<endl;
                break;
            }
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:20: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   26 |             if(find(prime.begin(),prime.end(),i)!=prime.end()&&find(prime.begin(),prime.end(),i-2)!=prime.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:26:20: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   26 |             if(find(prime.begin(),prime.end(),i)!=prime.end()&&find(prime.begin(),prime.end(),i-2)!=prime.end()){
      |                ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:26:68: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int)'
   26 |             if(find(prime.begin(),prime.end(),i)!=prime.end()&&find(prime.begin(),prime.end(),i-2)!=prime.end()){
      |                                                                ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:26:68: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   26 |             if(find(prime.begin(),prime.end(),i)!=prime.end()&&find(prime.begin(),prime.end(),i-2)!=prime.end()){
      |                                                                ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~