All test case are not working

#include
using namespace std;

int main() {

int N;

cin>>N;
int target;
int arr[1000];

for(int i=0;i<N;i++){
	cin>>arr[i];
}

cin>>target;
for(int i=0;i<N;i++){
	for(int j=i+1;j<N;j++){
    if(arr[i]+arr[j]==target)
	   cout<<arr[i]<<" and "<<arr[j]<<endl;
	}
}

return 0;

}

please sort the array

but I am doing using brute force so sort is not required

I know you are using brute force still the question asks you to print the pairs in increasing order so you have 2 options either store all the pairs and later sort them or sort the array so that you discover the pairs in increasing order itself

Ok thanks understood