求最大值最小值
#include <stdio.h>
int main()
{
float maxscore,minscore;
float s[10];
int i=1;
printf("请输入十位同学的数学成绩:");
scanf("%.1f",&s[10]);
maxscore=minscore=s[0];
while(i<10)
{
if(s[i]>maxscore)
{maxscore=s[i];}
if(s[i]<minscore)
{minscore=s[i];}
i++;
}
printf("在这十位同学中,成绩最高的是:%.lf分,成绩最低的是%.lf分",maxscore,minscore);
}
运行结果最大值最小值都为-1,求解huo