#include <stdio.h>
int main(){
int i,j,k,l,m;
int n = 20;
int a[20] = {6,7,8,9,10,15,14,13,12,11,8,9,15,14,13,15,14,3,2,1};
{
for (i = 0; i <19; i++)
{
for (k = i + 1; k < n; k++)
{
if (a[i] == a[k])
{
for (int j= k; j < n - 1; j++)
{
a[j] = a[j + 1];
}
}
}
}for(i=0;i<19;i++)
{
j = i;
for(k=i+1;k<20;k++)
if(a[k] > a[j]) j = k;
if(j!=i)
{
l= a[i];
a[i] = a[j];
a[j] = l;
}
}
for(m=0;m<5;m++)
printf("%d ",a[m]);
}
return 0;
}
int main(){
int i,j,k,l,m;
int n = 20;
int a[20] = {6,7,8,9,10,15,14,13,12,11,8,9,15,14,13,15,14,3,2,1};
{
for (i = 0; i <19; i++)
{
for (k = i + 1; k < n; k++)
{
if (a[i] == a[k])
{
for (int j= k; j < n - 1; j++)
{
a[j] = a[j + 1];
}
}
}
}for(i=0;i<19;i++)
{
j = i;
for(k=i+1;k<20;k++)
if(a[k] > a[j]) j = k;
if(j!=i)
{
l= a[i];
a[i] = a[j];
a[j] = l;
}
}
for(m=0;m<5;m++)
printf("%d ",a[m]);
}
return 0;
}