提交时间:2023-11-25 08:32:33
运行 ID: 111860
#include<bits/stdc++.h> using namespace std; signed main(){ int n; cin>>n; int sum = 1; if(n <= 2){ cout << 1; return 0; } if(n == 3){ cout << 2; return 0; } 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; }