I want to create an array that has 2 elements of array A
and 1 element of array B
.
test case:
A: 10,15,7,19,6,24,12,2,18
B: 13,21,5,3,14,9,17
result:
10,15,13,7,19,21,6,24,5,12,2,3,18,14,9,17
What should i do ?
#include <iostream>
using namespace std;
int main()
{
int n,m,s;
cout<<"please enter M :";
cin>>m;
cout<<"please enter N :";
cin>>n;
int a[m];
for(int i=0; i<m; i++)
{
cout<<"enter "<<i<<" number of an array";
cin>>a[i];
}
int b[n];
for(int i=0; i<m; i++)
{
cout<<"enter "<<i<<" number of an array";
cin>>b[i];
}
s = m + n;
int c[s];
return 0;
}