Title description
The value of an array in reverse order away again. For example, the original order of 8,6,5,4,1. Requirements changed to 1,4,5,6,8.
Input Format
Two input lines: the number n (n <= 100) in the first row of the array elements
Output Format
Output line: After output reverse integer array, each between two integers separated by spaces.
Sample input
5 8 6 5 4 1
Sample Output
1 4 5 6 8
#include <stdio.h>
int main()
{
int n,a[100],i;
while(scanf("%d",&n)!=EOF){
for(i=0;i<n;i++){
scanf("%d",a+i);
}
for(i=n-1;i>=0;i--)
printf("%d ",a[i]);
printf("\n");
}
return 0;
}