Scouring-reverse array replay-2687

Source: Internet
Author: User
2687: array reverse Replay
  • View
  • Submit
  • Statistics
  • Prompt
  • Question
Total time limit:
1000 ms
Memory limit:
65536kB
Description
Store the values in an array in reverse order. For example, the original sequence is 8, 6, 5, 4, 1. Change the value to, or 8.
Input
The input is two rows: the number of elements in the first array is n (1 <n <100), and the second row is n integers, separated by spaces.
Output
Output is a line: return the integer of the array in reverse order. Each two integers are separated by spaces.
Sample Input
58 6 5 4 1
Sample output
1 4 5 6 8
# Include <stdio. h> # include <stdlib. h> int main () {int n, I, j; int a [101]; scanf ("% d", & n); for (I = 0; I <n; I ++) {scanf ("% d", & a [I]) ;}for (j = n-1; j> = 0; j --) {printf ("% d", a [j]);} return 0 ;}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.