Advertisement
Josif_tepe

Untitled

May 18th, 2024
555
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main() {
  4.     string s;
  5.     cin >> s;
  6.    
  7.     int i = 0;
  8.     long long res = 1;
  9.     while(i < s.size()) {
  10.         if(s[i] == 'T' or s[i] == 't') {
  11.             res *= 3;
  12.             i += 8;
  13.         }
  14.         else if(s[i] == 'd' or s[i] == 'D') {
  15.             res *= 2;
  16.             i += 5;
  17.         }
  18.         else if(s[i] == 'm' or s[i] == 'M') {
  19.             res -= 1;
  20.             i += 5;
  21.         }
  22.     }
  23.     cout << res << endl;
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement