#include <stdio.h>
#define SIZE 10
void bubble_sort(int a[], int n);
void bubble_sort(int a[], int n)
{
int i, j, temp;
for (j=0; j<n-1; j++)
for (i=0; i<n-1-j; i++)
{
if(a[i] > a[i+1])
{
temp = a[i];
a[i] = a[i+1];
a[i+1] = temp;
}
}
}
int main()
{
int s[SIZE];
float sum = 0;
float ave = 0;
int i;
for (i= 0; i<SIZE; i++)
scanf("%d", &s[i]);
bubble_sort(s, SIZE);
printf("sort after:\n");
for (i=0; i<SIZE; i++)
{
sum += s[i];
printf("%d ", s[i]);
}
printf("\n");
ave = sum / SIZE;
printf("sum is %f\n", sum);
printf("ave is %f\n", ave);
}