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