#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
int arr[] = { 1,2,3,4,5,6,7,8,9,10 };
int sz = sizeof(arr) / sizeof(arr[0]);
printf("%d\n", sz);//计算数组个数
for (int i = 0; i < sz; i++)
{
printf("%d ", arr[i]);//正序打印
}
printf("\n");
int left = 0;
int right = sz - 1;
while (left < right)
{
int tmp = arr[left];
arr[left] = arr[right];
arr[right] = tmp;
left++;
right--;
}//逆序程序
for (int i = 0; i < sz; i++)
{
printf("%d ", arr[i]);//逆序打印
}
}