Algorithm Analysis
Read the input sequence into an array. Then print the elements of the array in reverse order.
Algorithm Implementation
Declare an array to store the sequence.
int m[101];
Read the input sequence into the array.
scanf("%d", &n); for (i = 0; i < n; i++) scanf("%d", &m[i]);
Print the elements of the array in one line and in reverse order.
for (i = n - 1; i >= 0; i--) printf("%d ", m[i]); printf("\n");