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 denari = 1;
- for(int i = 0; i < s.length(); ) {
- if(s[i] == 'T' or s[i] == 't') {
- denari *= 3;
- i += 8;
- }
- if(s[i] == 'D' or s[i] == 'd') {
- denari *= 2;
- i += 5;
- }
- if(s[i] == 'M' or s[i] == 'm') {
- denari -= 1;
- i += 5;
- }
- }
- cout << denari << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment