-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSection10.cpp
30 lines (24 loc) · 863 Bytes
/
Section10.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
string alphabet {" -abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"};
string klucz {" _baeicouydAEIOUfY0123g456h7JaeikouylAEIOUmY89!@n#$%p^"};
string kod{};
vector <int> temp2{};
string encrypted {} ;
string decrypted {} ;
cout<<"Code message: "<<endl;
getline(cin,kod);
for (int i{0}; i<=kod.size()-1; i++){
temp2.push_back(alphabet.find(kod.at(i)));
encrypted.push_back(klucz.at(temp2.at(i)));
decrypted.push_back(alphabet.at(temp2.at(i)));
}
cout<<"Encrypted message is: "<< encrypted<<endl;
cout<<"Decrypted message is: "<< decrypted<<endl;
cout<<"\n==========================="<<endl;
//
return 0;
}