#include <stdio.h>
int sum(int score[]){
int i,sum=0;
for(i=0;i<10;i++){
sum+=score[i];
}
printf("总分:%d\n",sum);
float avg = sum/10.0;
printf("平均分:%f\n",avg);
}
int max(int score[]){
int i,temp;
for(i=0;i<9;i++){
if(score[i]>score[i+1]){
temp = score[i];
score[i] = score[i+1];
score[i+1] = temp;
}
}
printf("最高分:%d\n",temp);
}
int min(int score[]){
int i,temp;
for(i=0;i<9;i++){
if(score[i]<score[i+1]){
temp = score[i];
score[i] = score[i+1];
score[i+1] = temp;
}
}
printf("最低分:%d\n",temp);
}
int rsort(int score[]){
int i,j,temp;
for(i=10;i>=0;i--){
for(j=0;j<i;j++){
if(score[j]<score[j+1]){
temp = score[j];
score[j] = score[j+1];
score[j+1] = temp;
}
}
}
for(i=0;i<9;i++){
printf("%d,",score[i]);
}
}
int main()
{
int score[10]={67,98,75,63,82,79,81,91,66,84};
sum(score);
max(score);
min(score);
rsort(score);
return 0;
}