题目链接:http://codeforces.com/problemset/problem/534/A
题目:
#include <stdio.h>
int main()
{
int n;
scanf("%d", &n);
if (n >= 5){
printf("%d\n", n);
for (int i = 1; i <= n; i+=2) {
if (i != 1) printf(" %d", i);
else printf("%d", i);
}
for (int i = 2; i <= n; i+=2) printf(" %d", i);
}
if (n == 1) {
printf("1\n");
printf("1\n");
}
if (n == 2) {
printf("1\n");
printf("1\n"); //wa一次
}
if (n == 3) {
printf("2\n");
printf("1 3\n");
}
if (n == 4) {
printf("4\n");
printf("3 1 4 2\n"); //wa 一次
}
}