Массив программ простого шифрованияC++

Программы на C++. Форум разработчиков
Гость
Массив программ простого шифрования

Сообщение Гость »


Building a simple program that multiplies the ASCII value of chars in a string by 3 to encrypt and then divide by 3 to decrypt. So far I got the encryption part down but whenever I enter what the encryption gave and try to decrypt it doesn't work. I think it has something to do with the buffer stream but I could be wrong if anyone could help.

Код: Выделить всё

#include  using namespace std; int main() {     string message;     int charValue;     int counter;     int encrypt;     char choice;     char quit = 'N';     while (quit == 'N')     {         cout > choice;         toupper(choice);         cout > message;         int messagelen = message.length();         string stringArray[255];         if (choice == 'E')         {             for (counter = 0; counter < messagelen; counter++) //*3 to ascii val             {                 stringArray[counter] = message[counter] * 3;             }             for (counter = 0; counter < messagelen; counter++)             {                 cout 

Источник: [url]https://stackoverflow.com/questions/69475710/simple-encryption-program-array[/url]

Вернуться в «C++»