Răspuns:
#include <iostream>
using namespace std;
int main()
{
unsigned int n,i,X,j,S,nr=0;
cout<<"n=";
cin>>n;
int a[n],b[10]={0};
for(i=0;i<n;i++)
{
cout<<"a["<<i<<"]=";
cin>>a[i];
}
for(i=0;i<n;i++)
if(a[i]%2!=0)
{
nr++;
while(a[i]>0)
{
X=a[i]%10;
b[X]++;
a[i]=a[i]/10;
}
S=0;
for(j=9;j>0;j--)
if(b[j]!=0)
while(b[j]>0)
{
S=S*10+j;
b[j]--;
}
cout<<S<<" ";
}
if(nr==0)
cout<<"nu exista";
return 0;
}
Explicație: