#include<bits/stdc++.h>
using namespace std;
void pairSum(int arr[], int n, int target)
{
int left = 0;
int right = n - 1;
while (left < right)
{
int sum = arr[left] + arr[right];
if (sum > target)
{
right++;
}
else if (sum < target)
{
left–;
}
else
{
cout << arr[left] << " and " << arr[right] << endl;
left–;
right++;
}
}
}
int main() {
int n;
cin>>n;
int arr[1000];
//int cs=0;
//t ms=0;
for(int i=0;i<n;i++)
{
cin>>arr[i];
}
int target;
cin>>target;
pairSum(arr,n,target);
return 0;
}
i am not understand what is the problem in my code