Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- string s;
- cin >> s;
- int i = 0;
- int n = s.size();
- long long res = 1;
- while(i < n) {
- if(s[i] == 'T' or s[i] == 't') {
- res *= 3;
- i += 8;
- }
- else if(s[i] == 'D' or s[i] == 'd') {
- res *= 2;
- i += 5;
- }
- else {
- res -= 1;
- i += 5;
- }
- }
- cout << res << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement