Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int x, y, i;
- long long brcount=1;
- string dtm; //dtm==duplo, troduplo i minus
- cin >> dtm;
- x = dtm.length();
- for(i=0; x>i; i++)
- {
- if(dtm[i]=='d' || dtm[i]=='D'){
- brcount*=2;
- i+=4;
- }
- if(dtm[i]=='t' ||dtm[i]=='T'){
- brcount*=3;
- i+=7;
- }if(dtm[i]=='m' || dtm[i]=='M'){
- brcount--;
- i+=4;
- }
- }
- cout << brcount;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment