Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- const int MAX = 'z' - 'a' + 1;
- int cript(const vector<char>& Dic, char c) {
- for (int i = 0; i < MAX; ++i) {
- if (c == Dic[i]) return i;
- }
- return 0;
- }
- int main() {
- vector<char> Dic(MAX);
- while (cin >> Dic[0]) {
- for (int i = 1; i < MAX; ++i) cin >> Dic[i];
- int cas;
- cin >> cas;
- for (int i = 0; i < cas; ++i) {
- char c;
- while (cin >> c and c != ' ') {
- if (c == '_') cout << " ";
- else {
- int k = cript(Dic, c);
- cout << char(k+ 'a');
- }
- }
- cout << endl;
- }
- cout << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment