Răspuns:
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,v[1001],i=0,minn=1000000,a;
cin>>n;
a=n;
while(a)
{
if(a%10<minn)
minn=a%10;
a/=10;
}
i++;
v[i]=minn;
minn=1000000;
while(n!=0)
{
cin>>n;
a=n;
i++;
while(a)
{
if(a%10<minn)
minn=a%10;
a/=10;
}
v[i]=minn;
minn=1000000;
}
for(int j=1;j<i;j++)
cout<<v[j];
return 0;
}
Explicație: