12944 - Traversal Linked List in Reverse Order   

Description

Please use the provided two files, main.c and function.h, to implement methods:

  1. Insert nodes to a list.
  2. Traversal a linked list in reverse order.

Go download function.c, and only need to submit function.c.

Input

n

N1 N2 N3 N4 … Nn

Note:

  1. n represents how many numbers would be provided.
  2. 32,767 >= n >= 0.
  3. 32,767 >= N(n) >= -32768.

Output

Output should follow below format:

Print: N1 N2 N3 N4 … Nn

Reverse: Nn Nn-1 Nn-2 … N1

Note that:

  1. Need to have a return value('\n') at the end of your output.
  2. Need a ‘Space’ between ‘:’ and N1.
  3. Need a ‘Space’ between any two numbers.

Sample Input  Download

Sample Output  Download

Partial Judge Code

12944.c

Partial Judge Header

12944.h

Tags




Discuss