Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  string S;
  cin>>S;
  int s=s.size;
  vector<int> x(s);
  vector<char> a={A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z};
  for(int i=0;i<s;i++){
     bool Q=false;
    for(int j=0;j<26;j++){
      if(s[i]==a[j]){
        x[i]=j;
        Q=true;
        break;
      }
    }
      if(Q==true)break;
    }
    for(int i=0;i<s;i++){
      s[i]=a[(x[i]+N)%26];
    }
    for(int i=0;i<s;i++){
      cout<<s[i];
    }
    cout<<endl;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: request for member 'size' in 's', which is of non-class type 'int'
    8 |   int s=s.size;
      |           ^~~~
a.cc:10:19: error: 'A' was not declared in this scope
   10 |   vector<char> a={A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z};
      |                   ^
a.cc:10:21: error: 'B' was not declared in this scope
   10 |   vector<char> a={A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z};
      |                     ^
a.cc:10:23: error: 'C' was not declared in this scope
   10 |   vector<char> a={A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z};
      |                       ^
a.cc:10:25: error: 'D' was not declared in this scope
   10 |   vector<char> a={A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z};
      |                         ^
a.cc:10:27: error: 'E' was not declared in this scope
   10 |   vector<char> a={A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z};
      |                           ^
a.cc:10:29: error: 'F' was not declared in this scope
   10 |   vector<char> a={A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z};
      |                             ^
a.cc:10:31: error: 'G' was not declared in this scope
   10 |   vector<char> a={A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z};
      |                               ^
a.cc:10:33: error: 'H' was not declared in this scope
   10 |   vector<char> a={A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z};
      |                                 ^
a.cc:10:35: error: 'I' was not declared in this scope
   10 |   vector<char> a={A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z};
      |                                   ^
a.cc:10:37: error: 'J' was not declared in this scope
   10 |   vector<char> a={A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z};
      |                                     ^
a.cc:10:39: error: 'K' was not declared in this scope
   10 |   vector<char> a={A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z};
      |                                       ^
a.cc:10:41: error: 'L' was not declared in this scope
   10 |   vector<char> a={A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z};
      |                                         ^
a.cc:10:43: error: 'M' was not declared in this scope
   10 |   vector<char> a={A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z};
      |                                           ^
a.cc:10:47: error: 'O' was not declared in this scope
   10 |   vector<char> a={A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z};
      |                                               ^
a.cc:10:49: error: 'P' was not declared in this scope
   10 |   vector<char> a={A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z};
      |                                                 ^
a.cc:10:51: error: 'Q' was not declared in this scope
   10 |   vector<char> a={A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z};
      |                                                   ^
a.cc:10:53: error: 'R' was not declared in this scope
   10 |   vector<char> a={A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z};
      |                                                     ^
a.cc:10:57: error: 'T' was not declared in this scope
   10 |   vector<char> a={A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z};
      |                                                         ^
a.cc:10:59: error: 'U' was not declared in this scope
   10 |   vector<char> a={A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z};
      |                                                           ^
a.cc:10:61: error: 'V' was not declared in this scope
   10 |   vector<char> a={A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z};
      |                                                             ^
a.cc:10:63: error: 'W' was not declared in this scope
   10 |   vector<char> a={A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z};
      |                                                               ^
a.cc:10:65: error: 'X' was not declared in this scope
   10 |   vector<char> a={A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z};
      |                                                                 ^
a.cc:10:67: error: 'Y' was not declared in this scope
   10 |   vector<char> a={A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z};
      |                                                                   ^
a.cc:10:69: error: 'Z' was not declared in this scope
   10 |   vector<char> a={A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z};
      |                                                                     ^
a.cc:10:70: error: could not convert '{<expression error>, <expression error>, <expression error>, <expression error>, <expression error>, <expression error>, <expression error>, <expression error>, <expression error>, <expression error>, <expression error>, <expression error>, <expression error>, N, <expression error>, <expression error>, <expression error>, <expression error>, S, <expression error>, <expression error>, <expression error>, <expression error>, <expression error>, <expression error>, <expression error>}' from '<brace-enclosed initializer list>' to 'std::vector<char>'
   10 |   vector<char> a={A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z};
      |                                                                      ^
      |                                                                      |
      |                                                                      <brace-enclosed initializer list>
a.cc:14:11: error: invalid types 'int[int]' for array subscript
   14 |       if(s[i]==a[j]){
      |           ^
a.cc:23:8: error: invalid types 'int[int]' for array subscript
   23 |       s[i]=a[(x[i]+N)%26];
      |        ^
a.cc:26:14: error: invalid types 'int[int]' for array subscript
   26 |       cout<<s[i];
      |              ^