#include <stdio.h>
int main()
{
int a[6] = {1,3,5,7,9};
int i;
int j;
int k;
for(i = 0 ; i < 5 ; i++)
printf("%5d",a[i]);
printf("\n");
printf("please enter k\n");
scanf("%d",&k);
a[5] = k;
for(i = 0 ; i < 6 ; i++)
for(j = 0 ; j < 6 ; j++)
{
int temp;
if(a[i] < a[j])
{
temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}
for(i = 0 ; i < 6 ; i++)
printf("%5d",a[i]);
printf("\n");
return 0;
}
int main()
{
int a[6] = {1,3,5,7,9};
int i;
int j;
int k;
for(i = 0 ; i < 5 ; i++)
printf("%5d",a[i]);
printf("\n");
printf("please enter k\n");
scanf("%d",&k);
a[5] = k;
for(i = 0 ; i < 6 ; i++)
for(j = 0 ; j < 6 ; j++)
{
int temp;
if(a[i] < a[j])
{
temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}
for(i = 0 ; i < 6 ; i++)
printf("%5d",a[i]);
printf("\n");
return 0;
}