Python写法
句子逆序
http://www.nowcoder.com/questionTerminal/48b3cb4e3c694d9da5526e6255bb73c3
python写法
import sys a = sys.stdin.readline().strip() # 去除\n等字符 a = a.split(' ') b = [] c = [0 for i in range(len(a))] for i in a: b.append(i) # 顺序存入列表 for i in range(len(a)): c[len(a)-1-i] = b[i] # 逆序存入列表 for i in range(len(a)): # 输出 print(c[i],end=' ')