Răspuns:
#include<iostream>
using namespace std;
int main()
{
int i,v[100],n,j,aux;
cin>>n;
for(i=1;i<=n;i++) cin>>v[i];
for(i=1;i<n;i++)
for (j=i+i;j<=n;j++)
if(v[i]<v[j])
{aux=v[i];
v[i]=v[j];
v[j]=aux;
}
cout<<v[1]<<" "<<v[2]<<" "<<v[3];
return 0;
}
Explicație: