Output is not correct ..please check

#include
#include<math.h>
#include
using namespace std ;
int main()
{
int t ;
cin >>t ;
while(t–)
{
int n;
cin >> n;
int a[n] ;
int b[n] ;
int c[n] ;
int max=-4000 ;
for(int i=0;i<n;i++)
{
cin >>a[i] ;
b[i]=a[i] ;
c[i]=floor(log10(a[i])+1) ;
if(c[i]>max)
max=c[i];
}

  for(int i=0;i<n;i++)
  {
	{
  		b[i]=b[i]*pow(10,max-c[i]) ;
	  }
  }
  int temp,temp1 ;
  for(int i=0;i<n-1;i++)
  {
  	for(int j=0;j<n-i-1;j++)
  		{
  	if(b[j+1]>b[j])
  			{
  				temp=b[j] ;
  				b[j]=b[j+1] ;
  				b[j+1]=temp ;
  				
  				temp1=c[j] ;
  				c[j]=c[j+1] ;
  				c[j+1]=temp1 ;
			  }
	   }
  }
  
  
 ///sort (b,b+5,greater<int>() ) ;
 for(int i=0;i<n;i++)
  {
  //	c[i]=floor(log10(b[i])+1) ;
  int m=pow(10,max-c[i]);
  	int d= b[i]/m ;
      cout<<d ;
  }	  	
cout <<endl;

}

}

Hi @3lokesharora, pls save your code here and share the URL here. Code here is not displaying properly.

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.