Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <iomanip>
- #include <string>
- #include <algorithm>
- #include <set>
- #include <list>
- #include <sstream>
- #include <vector>
- #include <map>
- #include <stdlib.h>
- using namespace std;
- ifstream in("input.txt");
- ofstream out("output.txt");
- int main() {
- string h;
- int n;
- string alph = "";
- for (char i = 'a'; i < 'z'; i++) {
- alph += i;
- }
- cin >> n >> h;
- string j = "";
- for (int i = 0; i < n-2; i++) {
- if (h[i + 2] == '0' && (i+2) < n) {
- string x(1, h[i]);
- string k(1, h[i + 1]);
- int c = stoi(x + k);
- j += alph[c - 1];
- i+=2;
- }
- else {
- string x(1, h[i]);
- int c = stoi(x);
- j += alph[c - 1];
- }
- }
- cout << j << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement