Advertisement
Josif_tepe

Untitled

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