asta e sursa mea de 100p de pe pbinfo. bafta la rezolvare!
int cmmnr(int x)
{ int i,j,y,nr=0,a[100],b=0;
y=x;
while (y!=0)
{
for (i=0;i<=9;i++)
if (y%10==i)
a[i]++;
y=y/10;
}
for (i=9;i>=0;i--)
{
y=x;
while (y!=0)
{
if (y%10==i)
b=b*10+i;
y=y/10;
}
}
return b;
}