Jump to content
YOUR-AD-HERE
HOSTING
TOOLS

Locked [C++] Simple string encoding


dEEpEst

Recommended Posts

[LENGUAJE=c+]#include

#include

using namespace std;

 

int main() {

setlocale(LC_ALL, "Russian");

 

cout

char *chText = new char; //Вводимый текст окда

cin >> chText;

cout

long long key;

cin >> key;

size_t sSize = strlen(chText); //Размер текста

 

int *piTemp = new int[sSize]; //Используется вместо static_castchText[индекс]

 

for (size_t c = 0; c

{

piTemp[c] = static_cast(chText[c]);

if (piTemp[c] > 64 && piTemp[c]

chText[c] += 32;

if (piTemp[c] > 127 && piTemp[c]

chText[c] += 32;

if (piTemp[c] > 143 && piTemp[c]

chText[c] += 80;

}

 

cout

for (size_t c = 0; c

{

cout (chText[c] ^ key);

}

cout

cout

cout

 

delete[] piTemp;

system("PAUSE >> VOID");

return 0;

}[/LENGUAJE]

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.