Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <stdlib.h>
- using namespace std;
- string ssl(string wort, char table[][26])
- {
- int i, j, n;
- char current;
- n = wort.length();
- std::string wort2=wort;
- for (i = 0; i < n; i++)
- {
- for (j = 0; j < 26; j++)
- {
- current = table[0][j];
- if (current == wort[i])
- {
- wort2[i] = table[1][j];
- }
- }
- }
- return wort2;
- }
- int main()
- {
- char feld[2][26] = { { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'K', 'L', 'M', 'O', 'P', 'R', 'S', 'T', 'U', 'W', 'X', 'Y', 'Z' },
- { 'R', 'S', 'T', 'U', 'W', 'X', 'Y', 'Z', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'K', 'L', 'M', 'O', 'P', 'A', 'B' } };
- std::string crypt = "HACKER";
- std::string test;
- test = ssl(crypt, feld);
- std::cout << test << std::endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement