#include
using namespace std;
int main() {
int x,n,i;
int arr[100001]={0};
int count=0;
cin>>n;
for(i=0;i<n;i++)
{
cin>>x;
arr[x]++;
}
int target;
cin>>target;
for(i=1;i<=100000;i++)
{
if(arr[i]>0 && arr[target-i]>0)
{
cout<<i<<" and "<<target-i<<endl;
arr[target-i]=0;
arr[i]=0;
}
}
return 0;
}
can anybod help?
what is wrong in this code?