include <stdio.h>
include <stdlib.h>
int main()
{
int a[]={45,65,3,5,76,34,7,45,7,9,3};
// {3,65,45,5,76,34,7,45,7,9,3}
// {3,45,65,5,76,34,7,45,7,9,3}
// {3,5,65,45,76,34,7,45,7,9,3}
// {3,3,65,45,76,34,7,45,7,9,5}
// {3,3,45,65,76,34,7,45,7,9,5}
// {3,3,34,65,76,45,7,45,7,9,5}
// {3,3,7,65,76,45,34,45,7,9,5}
// {3,3,5,65,76,45,34,45,7,9,7}
// {3,3,5,45,76,65,34,45,7,9,7}
// {3,3,5,34,76,65,45,45,7,9,7}
// {3,3,5,7,76,65,45,45,34,9,7}
// {3,3,5,7,65,76,45,45,34,9,7}
// {3,3,5,7,45,76,65,45,34,9,7}
// {3,3,5,7,34,76,65,45,45,9,7}
// {3,3,5,7,9,76,65,45,45,34,7}
// {3,3,5,7,7,76,65,45,45,34,9}
// {3,3,5,7,7,65,76,45,45,34,9}
// {3,3,5,7,7,45,76,65,45,34,9}
// {3,3,5,7,7,34,76,65,45,45,9}
// {3,3,5,7,7,9,76,65,45,45,34}
//1.把a数组里面的最大值找出来
//2.把a数组里面的元素从小到大排序打印出来
int i,j;
int length = sizeof(a)/sizeof(int);
for(i=0;i<length;i++){
for(j=i+1;j<length;j++){
if(a[i]> a[j]){
int temp = a[i];
a[i]=a[j];
a[j]=temp;
}
}
}
for(i=0;i<length;i++){
printf("%d,",a[i]);
}
printf("\n");
//打印数组的长度
// printf("long=%ld\n",sizeof(a)/sizeof(int));
// int i;
// int length = sizeof(a)/sizeof(int);
// int max = a[0];
// for(i=0;i<length;i++){
// if(max<a[i]){
// max = a[i];
// }
// }
// printf("max=%d",max);
return 0;
}