Test case 0 is not passing and other is passing

#include
using namespace std;
int main(){
int n;
cin>>n;
int temp[n][n]={0};
int arr[10009];
for(int i=0;i<n;i++){
cin>>arr[i];
}
int target;
cin>>target;
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
if(arr[i]+arr[j]==target and temp[i][j]!=1){

            if(arr[i]<=arr[j]){
                cout<<arr[i]<<" and "<<arr[j]<<endl;
            }
            else
            {
                cout<<arr[j]<<" and "<<arr[i]<<endl;
            }
            temp[i][j]=1;
            temp[j][i]=1;
        }
    }
}
return 0;

}

@proraj9088 Try a two pointers approach. It would not pass if test cases are huge.