Răspuns:
#include <iostream>
using namespace std;
int b[101];
int main(){
int n,v[101],c,s,i,x;
cin >> n;
cin >> x;
for(i=1;i<=n;i++)
cin >> v[i];
c = 1;
for(i=1;i<=n;i++)
if (v[i] <= x ){
b[c] = v[i];
c++;}
for(i=1;i<n;i++)
for(s=1;s<n-1;s++)
if(b[s] < b[s+1])
swap(b[s],b[s+1]);
for(i=1;i<n;i++)
cout << b[i] << " ";
return 0;}
Explicație: