Josif_tepe

Untitled

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