#include
#include
using namespace std;
int Target(int a[],int n,int b)
{
for(int i=0;i<n;i++)
{for(int j=i+1;j<n;j++)
{
for(int k=j+1;k<n;k++)
{
if(a[i]+a[j]+a[k]==b)
{
cout<<a[i]<<", “<<a[j]<<” and "<<a[k];
cout<<endl;
}
}
}
}
}
int main()
{
int n,i,a[1000],j,b;
cin>>n;
for(i=0;i<n;i++)
cin>>a[i];
cin>>b;
sort(a,a+n);
Target(a,n,b);
return 0;
}
2 testcases are failed whats the problem
so plz tell my mistake
plz answer completely in one go