#include <iostream>
using namespace std;
long long a[51];

int main()
{
    int n;
    a[1] = 3;
    a[2] = 6;
    a[3] = 6;
    for (int i = 4; i <= 50; i++)
    {
        a[i] = a[i - 1] + 2 * a[i - 2];
    }
    while (cin >> n)
    {
        cout << a[n] << endl;
    }
}

 

相关文章:

  • 2021-11-13
  • 2022-12-23
  • 2021-10-31
  • 2021-05-10
  • 2022-12-23
  • 2021-06-14
  • 2022-12-23
  • 2021-09-08
猜你喜欢
  • 2022-12-23
  • 2021-05-27
  • 2022-12-23
  • 2021-08-14
  • 2022-02-05
  • 2022-12-23
  • 2021-07-13
相关资源
相似解决方案