Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define task "CHANGE"
- #include <iostream>
- #include <cstdio>
- using namespace std;
- using ll = long long;
- using ld = long double;
- constexpr int N = 1e5 + 5;
- string s, ans;
- void Read()
- {
- cin >> s;
- }
- void Solve()
- {
- ans = "12345678";
- for (auto i : s)
- if (i == 'R')
- ans = ans.substr(ans.size() - 1, 1) + ans.substr(0, ans.size() - 1);
- else
- ans = ans.substr(1, ans.size() - 1) + ans.substr(0, 1);
- cout << ans;
- }
- int32_t main()
- {
- ios::sync_with_stdio(0);
- cin.tie(0);
- cout.tie(0);
- if (fopen(task ".INP", "r"))
- {
- freopen(task ".INP", "r", stdin);
- freopen(task ".OUT", "w", stdout);
- }
- Read();
- Solve();
- }
Advertisement
Add Comment
Please, Sign In to add comment