Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     int n;
  7.     cin >> n;
  8.     int totalLikes = 0;
  9.     int current = 5;
  10.     for (int i=0; i<n; ++i) {
  11.         totalLikes += current / 2;
  12.         current = (current / 2) * 3;
  13.     }
  14.     cout << totalLikes << endl;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement