hihoCoder Challenge 32 register

Ended

Participants:282

Verdict:Accepted
Submitted:2017-12-03 19:06:48

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <iostream>
using namespace std;
int n;
int main() {
    int n;
    cin >> n;
    cout << 1;
    for (int i = 3; i <= n; i += 2) {
        cout << " " << i;
    }
    if (n % 2 == 1) n--;
    for (int i = n; i > 1; i -= 2) {
        cout << " " << i;
    }
    cout << endl;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX