Advertisement
amine99

Untitled

Apr 7th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.18 KB | None | 0 0
  1. int dmg(string s) {
  2.    int damage=1,cnt=0;
  3.    loop(i,0,s.length()-1) {
  4.       if(s[i] == 'S')
  5.          cnt += damage;
  6.       else
  7.          damage *= 2;
  8.    }
  9.    return cnt;
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement