int main() {
int N = 20; int k = 11;;
int M[N - 1] = { 1,2,5,8,2,5,8,10,11,1,3,1,11,10,1,11,7,7,3,1 };
int MM[N - 1] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
int S[k - 1] = { 5,4,3,2,1,7,8,9,10,11,6 };
cout << "Массив M " << N << " элементов" << endl;
for (int i = 0; i < N; i++) cout << M[i] << " ";
cout << endl;
cout << "Массив S " << k << " элементов" << endl;
for (int i = 0; i < k; i++) cout << S[i] << " ";
cout << endl;
cout << "Массив до шифрования " << N << " элементов" << endl;
for (int i = 0; i < N; i++) cout << MM[i] << " ";
cout << endl;
int q;
for (int i = 0; i < N; i++)
{
q = M[i];
MM[i] = S[q - 1];
}
cout << "Массив после шифрования " << N << " элементов" << endl;
for (int i = 0; i < N; i++) cout << MM[i] << " ";
}