int main()
{
int a ;
int temp[4];
int arr[4] = {1,2,3,4};
int arr12[4] = {5,6,7,8};
for (a = 0; a <= 3; a++)
{
temp[a] = arr[a];
arr[a] = arr12[a];
arr12[a] = temp[a];
}
for (a = 0; a <= 3; a++)
{
printf("%d ", arr[a]);
}
printf("\n");
for (a = 0; a <= 3; a++)
{
printf("%d ", arr12[a]);
}
return 0;
}
学习心得数组交换数据
最新推荐文章于 2024-09-11 22:48:33 发布