#include<stdio.h>
void BubbleSort(int *num)
{
for(int i=1; i<6; i++)
{
for(int j=6-1; j>=1; j--)
{
if(num[j] > num[j+1])
{
int temp = 0;
temp = num[j];
num[j] = num[j+1];
num[j+1] = temp;
}
}
}
}
void InsertSort(int *num)
{
for(int i=2; i<=6; i++)
{
int temp = num[i];
for(int j=i-1; j>=1; j--)
{
if(temp < num[j])
{
num[j+1] = num[j];
num[j] = temp;
}
else
{
num[j+1] = temp;
break;
}
}
}
}
void SelectSort(int *num)
{
for(int i=1; i<6; i++)
{
int temp = i;
for(int j=i+1; j<=6; j++)
{
if(num[temp] > num[j])
temp = j;
}
if(temp != i)
{
int temp1 = num[i];
num[i] = num[temp];
num[temp] = temp1;
}
}
}
int main()
{
int num[7] = {7, 6, 5, 4, 3, 2, 1};
// BubbleSort(num);
InsertSort(num);
// SelectSort(num);
printf("1-%d 2-%d 3-%d 4-%d 5-%d 6-%d/n",
num[1], num[2], num[3], num[4], num[5], num[6]);
}