提交时间:2023-11-25 08:16:09

运行 ID: 111808

#include <bits/stdc++.h> using namespace std; int a[60]; int main() { int n; cin >> n; int sum = 1; int cnt = n / 3; if(n % 3 == 1) { cnt -= 1; for(int i = 1;i <= cnt;i++) sum *= 3; sum *= 4; cout << sum; return 0; } if(n % 3 == 2) { for(int i = 1;i <= cnt;i++) sum *= 3; sum *= 2; cout << sum; return 0; } return 0; }