1547: 【c11】用swap()把数组内容互换▃
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:14
Solved:14
Description
创建n个长度的数组并输入元素内容。用swap()方法把数组前后元素交换,实现倒序的效果。
Input
第1行:输入一个正整数n,n < 10;创建int a[n]长度的数组。
第2行:输入n个正整数,各数用空格隔开。把数字存储到a数组中。
Output
输出倒序以后的数组内容,各数用空格隔开。
Sample Input Copy
5
1 3 5 7 9
Sample Output Copy
9 7 5 3 1