其他分享
首页 > 其他分享> > 课表排列

课表排列

作者:互联网

P5823 【L&K R-03】课表的排列 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn)

// https://www.luogu.com.cn/problem/P5823
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define MAX 10000001
int main()
{
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        printf("%d ", i);
    }
    for (int i = 1; i <= n; i += 2)
    {
        printf("%d ", i);
    }
    for (int i = 2; i <= n; i += 2)
    {
        printf("%d ", i);
    }
}

 

标签:偶数,排列,cn,奇数,int,long,课表
来源: https://www.cnblogs.com/Wang-Xianyi/p/16574663.html