#include<stdio.h>
int main()
{
int arr1[] = { 1,3,5,7,9 };
int arr2[] = { 2,4,6,8,10 };
int i = 0;
int sz = sizeof(arr1) / arr1[0];
int temp = 0;
for (i = 0; i < sz; i++)
{
temp = arr1[i];
arr1[i] = arr2[i];
arr2[i] = temp;
}
return 0;
}
对两个数组进行交换
最新推荐文章于 2024-03-05 17:06:29 发布