#include <stdio.h>
int main()
{
int score[10]={67,98,75,63,82,79,81,91,66,84};
int sum,i,j,high,low;
for(i=0;i<10;i++)
{
sum+=score[i];
}
int average;
average=sum/10;
printf("考试的总分%d\n",sum);
printf("考试的平均分%d\n",average);
for(i=9;i>=0;i--)
{
for(j=0;j<=i;j++)
{
if(score[j]>score[j+1]);
{
double temp;
temp = score[j];
score[j]=score[j+1];
score[j+1]=temp;
}
}
}
high=score[9];
low=score[0];
printf("考试的最高分%d\n",high);
printf("考试的最低分%d\n",low);
return 0;
}
已解决
/bin/bash: line 1: 24478 Segmentation fault (core dumped) hello 考试的总分786
右边显示这个愣是没看懂