#include
using namespace std;
#include
#include
#include
int main(){
int n; int a[1000]; int b[1000];
cin>>n;
for(int i=0;i<n;i++) cin>>a[i];
for(int i=0;i<n;i++) cin>>b[i];
//merge sort of the two arrys
int i=0,j=0;
vectorc; int k=0;
//merged array
while(i<n && j<n){
if(a[i]<b[i]) c[k++]=a[i++];
else c[k++]=b[j++];
}
// Copy the remaining elements of array a, if any
while (i < n) c[k++] = a[i++];
// Copy the remaining elements of array b, if any
while (j < n) c[k++] = b[j++];
if(c.size()%2!=0) cout<<c[c.size()/2];
return 0;
}
Segmentation fault is occurring at line 17. Why??