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