1、程序填空,该程序功能是:从键盘输入10名学生的成绩,显示其中的最高分、最低分和平均成绩?

#include <stdio.h>

int main()

{

/**********found**********/

float s[10], ___1___;

float max, min, average;

int i;

for ( i = 0; i < 10; i++ )

{

scanf( "%f", p++ );

}

/**********found**********/

___2___;

/**********found**********/

max = min = average = ___3___;

for ( i = 1; i < 10; i++ )

{

if ( *( p + i ) > max )

{

max = *( p + i );

}

if ( *( p + i ) < min )

{

min = *( p + i );

}

average += *( p + i );

}

/**********found**********/

average /= ___4___;

printf( "max=%.2f,min=%.2f,average=%.2f\n", max, min, average );

}

#include <stdio.h>
int main()
{ /**********found**********/
float s[10], *p=s;
float max, min, average;
int i;
for ( i = 0; i < 10; i++ )
{ scanf( "%f", p++ );
}
/**********found**********/
p=s;
/**********found**********/
max = min = average = *p;
for ( i = 1; i < 10; i++ )
{ if ( *( p + i ) > max )
{ max = *( p + i );
}
if ( *( p + i ) < min )
{ min = *( p + i );
}
average += *( p + i );
}
/**********found**********/
average /= 10;
printf( "max=%.2f,min=%.2f,average=%.2f\n", max, min, average );
}
温馨提示:内容为网友见解,仅供参考
第1个回答  2020-06-23
1.*p=s
2.p=s
3.*p
4.10本回答被提问者采纳
相似回答