我怎样才能让这个程序看起来不仅仅是第一个字符?

How can i make this program look at more than the first character?

#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() {
const int setNum = 26;
vector<char> normalV(setNum);
vector<char> cipherV(setNum);
string toDec = "";
string beenDec = "";
int i = 0;

normalV.at(i) = 'a'; cipherV.at(i) = '!'; ++i;
normalV.at(i) = 'b'; cipherV.at(i) = '^'; ++i;
normalV.at(i) = 'c'; cipherV.at(i) = '&'; ++i;
normalV.at(i) = 'd'; cipherV.at(i) = '*'; ++i;
normalV.at(i) = 'e'; cipherV.at(i) = '@'; ++i;
normalV.at(i) = 'f'; cipherV.at(i) = '('; ++i;
normalV.at(i) = 'g'; cipherV.at(i) = ')'; ++i;
normalV.at(i) = 'h'; cipherV.at(i) = '-'; ++i;
normalV.at(i) = 'i'; cipherV.at(i) = '#'; ++i;
normalV.at(i) = 'j'; cipherV.at(i) = '_'; ++i;
normalV.at(i) = 'k'; cipherV.at(i) = '='; ++i;
normalV.at(i) = 'l'; cipherV.at(i) = '+'; ++i;
normalV.at(i) = 'm'; cipherV.at(i) = '['; ++i;
normalV.at(i) = 'n'; cipherV.at(i) = '{'; ++i;
normalV.at(i) = 'o'; cipherV.at(i) = '$'; ++i;
normalV.at(i) = 'p'; cipherV.at(i) = ']'; ++i;
normalV.at(i) = 'q'; cipherV.at(i) = '}'; ++i;
normalV.at(i) = 'r'; cipherV.at(i) = ';'; ++i;
normalV.at(i) = 's'; cipherV.at(i) = ':'; ++i;
normalV.at(i) = 't'; cipherV.at(i) = ','; ++i;
normalV.at(i) = 'u'; cipherV.at(i) = '%'; ++i;
normalV.at(i) = 'v'; cipherV.at(i) = '<'; ++i;
normalV.at(i) = 'w'; cipherV.at(i) = '.'; ++i;
normalV.at(i) = 'x'; cipherV.at(i) = '>'; ++i;
normalV.at(i) = 'y'; cipherV.at(i) = '/'; ++i;
normalV.at(i) = 'z'; cipherV.at(i) = '?'; ++i;

// User inputs message
do {
    cout << "Enter a secret message: ";
    getline(cin, toDec);
} while (toDec.length() == 0);

beenDec = toDec;

//decodes user's message
for (i = 0; i < setNum; ++i){
if (toDec.at(0) == cipherV.at(i)) {
        beenDec.at(0) = normalV.at(i);
    }
}

//diplays decoded message
cout << "Decrypted message: " << beenDec << endl;

//command drive to stay open
cin.get();
cin.get();
return 0;
}

任何帮助都将不胜感激。该代码应该解码一个字符串,例如“!^&”应该输出到 "abc"。现在它只是像这样解码第一个字母 "a^&"。我觉得这是因为它被定义为一个字符而不是一个字符串但是如果我改变它它会给我错误。关于如何修改它以使其工作的任何想法?提前致谢

我觉得循环应该是这样的-:

//decodes user's message
for ( unsigned j = 0; j < toDec.length(); j++ )
{
    for ( i = 0; i < setNum; ++i )
    {
        if ( toDec.at( j ) == cipherV.at( i ) )
        {
            beenDec.at( j ) = normalV.at( i );
        }
    }
}