提交时间:2023-11-25 08:30:22
运行 ID: 111854
#include<bits/stdc++.h> using namespace std; signed main(){ int n; cin>>n; int sum = 1; if(n <= 2){ cout << 1; } if(n == 3){ cout << 2; } for(int i = 1;i <= n/3-1;i++){ if(i == n/3-1){ sum *= 3; } } if(n%3 == 2){ sum *= 6; }else{ sum *= (3+(n%3)); } cout << sum; return 0; }