Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- using ll = long long;
- using ld = long double;
- ll ap;
- string ad(string x, map<char, string> &z1)
- {
- stringstream a(x);
- char h;
- a >> h;
- x = string(1, h);
- ll w;
- a >> w;
- ap = w;
- for (auto &cl : z1)
- {
- cl.second += string(w - 1, cl.second.at(cl.second.size() - 1));
- }
- return x;
- }
- int main()
- {
- string a1, a2;
- a1 = "FDBgea";
- a2 = "GECAfdcb";
- ll n;
- cin >> n;
- cin.ignore();
- string x;
- getline(cin, x);
- stringstream ss(x);
- map<char, string> z1;
- ll i = 0;
- for (auto cl : a1)
- {
- z1[cl] = string(n * 2 - 1, '-');
- }
- for (auto cl : a2)
- {
- z1[cl] = string(n * 2 - 1, ' ');
- }
- while (n-- > 0)
- {
- ss >> x;
- if (x.size() == 1)
- {
- z1[x.at(0)].at(i) = '*';
- i += 2;
- }
- else
- {
- x = ad(x, z1);
- while (ap-- > 0)
- {
- z1[x.at(0)].at(i) = '*';
- i++;
- }
- i++;
- }
- }
- x = "GFEDCBAgfedcba";
- for (auto cl : x)
- {
- cout << cl << ": " << z1[cl] << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment