AcWing 814. 复制数组
作者:互联网
文章目录
AcWing 814. 复制数组
本题链接:AcWing 814. 复制数组
本博客给出本题截图:
AC代码
代码:
#include <cstring>
#include <iostream>
using namespace std;
const int N = 110;
void copy(int a[], int b[], int size)
{
memcpy(b, a, size * 4);
}
int main()
{
int a[N], b[N];
int n, m, size;
cin >> n >> m >> size;
for (int i = 0; i < n; i ++ ) cin >> a[i];
for (int i = 0; i < m; i ++ ) cin >> b[i];
copy(a, b, size);
for (int i = 0; i < m; i ++ ) cout << b[i] << ' ';
cout << endl;
return 0;
}
标签:int,cin,++,数组,AcWing,814,size 来源: https://blog.csdn.net/qq_52156445/article/details/120685648