函数connectAB将b数组所有元素按原顺序分别存放到a数组a[n-1]元素的后面,使得a数组变成n+m个元素
#include"stdio.h"constintN0=100;voidconnectAB(inta[],int*n,intb[],int*m){//**********...
#include "stdio.h"
const int N0=100;
void connectAB( int a[], int *n, int b[], int *m)
{
//************************************************
//=================================================
}
int main()
{ int n, a[2*N0], m, b[N0], i;
freopen("C6_1B.in", "r", stdin);
freopen("C6_1B.out", "w", stdout);
scanf("%d", &n);
for( i=0; i<n; i++)
scanf("%d", &a[i]);
scanf("%d", &m);
for( i=0; i<m; i++)
scanf("%d", &b[i]);
connectAB( a, &n, b, &m);
for( i=0; i<n-1; i++)
printf("%d ", a[i]);
printf("%d\n", a[n-1]);
return 0;
} 展开
const int N0=100;
void connectAB( int a[], int *n, int b[], int *m)
{
//************************************************
//=================================================
}
int main()
{ int n, a[2*N0], m, b[N0], i;
freopen("C6_1B.in", "r", stdin);
freopen("C6_1B.out", "w", stdout);
scanf("%d", &n);
for( i=0; i<n; i++)
scanf("%d", &a[i]);
scanf("%d", &m);
for( i=0; i<m; i++)
scanf("%d", &b[i]);
connectAB( a, &n, b, &m);
for( i=0; i<n-1; i++)
printf("%d ", a[i]);
printf("%d\n", a[n-1]);
return 0;
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询