-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchenmang2.c
More file actions
38 lines (38 loc) · 735 Bytes
/
chenmang2.c
File metadata and controls
38 lines (38 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <stdio.h>
void nhapmang(int n, int a[])
{
for (int i = 0; i < n; i++)
scanf("%d", &a[i]);
}
void inmang(int n, int a[])
{
for (int i = 0; i < n; i++)
printf("%d ", a[i]);
}
int main()
{
int t, c = 0;
scanf("%d", &t);
while (c < t)
{
int n, m, p;
scanf("%d%d%d", &n, &m, &p);
int a[100], b[100];
nhapmang(n, a);
nhapmang(m, b);
for (int i = n + m - 1; i >= m + p; i--)
{
a[i] = a[i - m];
}
for (int j = p; j < p + m; j++)
{
a[j] = b[j - p];
n++;
}
printf("Test %d:\n", c + 1);
inmang(n, a);
printf("\n");
c++;
}
return 0;
}