Welcome   HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online
Home
FAQs
Problem Set
Practices
Online Contests
Major Exercises
OI Special
Judgement
Submit
Online Status
User Ranklist
Users
Register new
Login
Web Links
Hunan Normal University
College of Information Science and Engineering
建立反向链表
Time Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:32768KB
Total submit users: 159, Accepted users: 156
Problem 10493 : No special judgement
Problem description
  建立一个单向链表,然后在原链表地基础上将其反向。如建立正向链表1、2、3、4、5,反向后为5、4、3、2、1。

Input
  输入数据有若干组。每组数据一行,第一个整数为n,表示链表有n个结点,接下来为n个整数表示n个结点的数据。

Output
  对每组数据,输出反向之后的结果,数据之间用空格分隔,每组最后一个数据后无空格。

Sample Input
2 1 2
3 1 2 3
1 0
Sample Output
2 1
3 2 1
0
Submit   Clarifications   Judge Status  Problems  Ranklist 

HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online, Version 2010.5.5.final.
Web visits:2131 today,16258858 total, since 2010-05-07