velimir

trajko

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