11656 - Simple Permutation   

Description

Writers : jjjjj19980806 & pclightyear

Given an integer n, please output a sequence of integers as described below :

(1) The sequence consists of 2n – 1 integers.

(2) Output format : 1 2 … n-1 n n-1 … 2 1

(3) There is a whitespace behind each integer except for the last number.

(4) Remember to output '\n' after you print out your answer.

Note :

(1) This is a partial judge problem. Make sure to download partial judge code and partial judge header we give to you. Before you submit your code, your code should be compiled successfully on your computer. (If you run into any trouble, feel free to ask on ilms.)

(2) These keywords should not appear in your submission : for, while, goto. (i.e. you can’t use any loopotherwise your will receive compiler error.)

(3) You can’t declare any global variable and function except for “print()” (which is declared in the header file we give to you) in your code.

(4) You need to choose C Language instead of C++.

(5) Your submission will look like :

 

#include <stdio.h>

#include "function.h"

// Not "11656.h" !!

void print(int level, int n){

    // add your code here!

}

 

Input

There is only one integer n in the input file.

  • 1 ≤ n ≤ 10

Output

As described above.

You can find out more information in sample output.

Sample Input  Download

Sample Output  Download

Partial Judge Code

11656.c

Partial Judge Header

11656.h

Tags




Discuss