[CODE lang="cpp" title="C++"]#include <iostream>
#include <cstring>
#include <cctype>
using namespace std;
int main() {
string alphabet {"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"};
string Key {"XZNLWEBGJHQDYVTKFUOMPCIASRxznlwebgjhqdyvtkfuompciasr"};
string secret_word {};
string ecrypted_word {};
cout << "Enter the secret word: ";
getline(cin, secret_word);
cout << "Ecrypting secret word.." << endl;
for(char c: secret_word){
size_t position = alphabet.find(c);
if (position != string::npos) {
char new_char { Key.at(position) };
ecrypted_word += new_char;
}
else.
position += c;
}
cout << "Ecrypted word is: " << ecrypted_word << endl;
return 0;
}[/CODE]
Bunu çalıştırınca mesela, secret message yazdım bunu arada boşluk olmadan çeviriyor nasıl düzeltebiliri m?