I want to ask why this is not working?
#include
using namespace std;
int main() {
int N,i,j;
cin>>N;
int a[N];
for(i=0;i<N;i++)
{
cin>>a[i];
}
int temp;
for(i=0;i<N-1;i++)
{
int min=a[i];
for(j=i+1;j<N;j++)
{
if(min>a[j])
{
min=a[j];
}
}
temp=min;
min=a[i];
a[i]=temp;
}
for(i=0;i<N;i++)
{
cout<<a[i]<<endl;
}
return 0;
}