This requires writing a program, storing the given n integers in an array, holding the number of n in an array in reverse order, and then outputting the elements in the array sequentially.
Input format:
The input gives a positive integer N (1≤n≤10) in the first row. The second line enters n integers, separated by a space.
Output format:
Outputs the result of the processing of these n integers in a row, separated by a space in the middle of the adjacent number, with no extra space at the end of the line.
Input Sample:
410 8 1 2
Sample output:
2 1 8 10
#include <stdio.h>Const intmaxn= -;intA[MAXN];intMain () {intN; scanf ("%d",&N); intCount=0; intB[MAXN]; for(intI=0; i<n;i++) {scanf ("%d",&A[i]); } for(inti=n-1; i>=0; i--) {B[count]=A[i]; Count++; } printf ("%d", b[0]); for(intI=1; i<n;i++) {printf ("%d", B[i]); } return 0;}
Exercise 7-3 storing the number in reverse order (20 points) in an array