Please tell the error

#include
#include
using namespace std;
int main()
{
int T;
cin>>T;
while(T–)
{
int n;
cin>>n;
int a[10];
for(int i=0;i<n;i++)
{
cin>>a[i];
}
int temp=1;
int cmpy=1;
while(temp–){
next_permutation(a,a+n);
next_permutation(a,a+n);
}
cmpy++;
cmpy=temp;
cout<<"\n";
for(int i=0;i<n;i++)
{
cout<<a[i]<<" ";
}
}
return 0;
}

hello @janmejai20singh
a) value of n can be upto 1000 so increase ur array size.
b) call next permuatation only one time.
c) print output of each test case in separate line

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.