Răspuns: #include <iostream>
using namespace std;
int sub(unsigned n, unsigned v[],unsigned s)
{ int i,ok,aux;
unsigned a[100],k=0;
for(i=0;i<n;i++)
if(v[i]%10+(v[i]/10)%10>s)
{
a[k]=v[i];
k++;
}
if(k>1)
{do{ok=1;
for(i=0;i<k;i++)
if(a[i]>a[i+1])
{
aux=a[i];
a[i]=a[i+1];
a[i+1]=aux;
ok=0;
}
}while(ok==0);}
for(i=0;i<k;i++)
cout<<a[i]<<' ';
if(k==0)
cout<<"Nu exista";
}
int main()
{unsigned n,v[100],s,i;
cin>>n;
cin>>s;
for(i=0;i<n;i++)
cin>>v[i];
sub(n,v,s);
return 0;
}
Explicație: