魈凯KBS • 1年前
using namespace std; int dp[205]; signed main(){
ios::sync_with_stdio(false);
cin.tie(0),cout.tie(0);
int n;
cin>>n;
dp[1] = 2;
cout<<"2 ";
for (int i = 2;i <= n;i++){
if (i & 1){
dp[i] = dp[i - 1] + 3;
}
else{
dp[i] = dp[i - 1] - 1;
}
cout<<dp[i]<<' ';
}
return 0;
}
评论: