a guest Aug 20th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- # Task
- # Given an array, A, of N integers, print A's elements in reverse order as a single line of space-separated numbers.
- # Input Format
- # The first line contains an integer, N (the size of our array).
- # The second line contains N space-separated integers describing array A's elements.
- # Constraints
- # 1 <= N <= 1000
- # 1 <= Ai <= 10000, where Ai is the ith integer in the array
- # Output Format
- # Print the elements of array A in reverse order as a single line of space-separated numbers.
- import sys
- n = int(raw_input().strip())
- arr = map(int,raw_input().strip().split(' '))
- a = arr[::-1]
- print " ".join(str(x) for x in a)
- © 2019 GitHub, Inc.
RAW Paste Data