下面程序的功能是用函数编程实现两个数组中对应元素值的交换。按要求在空白处填写适当的表达式或语句,使程序完整并符合题目要求。程序的运行结果示例:Input array size(n<=10):5↙Input array a:1 2 3 4 5↙Input array b:6 7 8 9 10↙Output array a: 6 7 8 9 10Output array b: 1 2 3 4 5#include
#define N 10
void ReadData(int a[], int n);
void PrintData(int a[], int n);
void Swap(int *x, int *y);
int main()
{
int a[N], b[N], i, n;
printf("Input array size(n<=10):");
scanf("%d", &n);
printf("Input array a:");
ReadData(a, n);
printf("Input array b:");
ReadData(b, n);
for (i=0; i 选项:
A:第17行:&a[i], &b[i]第52行:temp = *x第53行:*x = *y第54行:*y = temp;
B:第17行:a[i], b[i]第52行:temp = *x第53行:*x = *y第54行:*y = temp;
C:第17行:&a[i], &b[i]第52行:*temp = *x第53行:*x = *y第54行:*y = *temp;
D:第17行:a[i], b[i]第52行:temp = x第53行:x = y第54行:y = temp
A:第17行:&a[i], &b[i]第52行:temp = *x第53行:*x = *y第54行:*y = temp;
B:第17行:a[i], b[i]第52行:temp = *x第53行:*x = *y第54行:*y = temp;
C:第17行:&a[i], &b[i]第52行:*temp = *x第53行:*x = *y第54行:*y = *temp;
D:第17行:a[i], b[i]第52行:temp = x第53行:x = y第54行:y = temp
发布时间:2024-06-13 19:57:05