回复 6楼 梁2
因为是double类型所以scanf里边用%lf获取,刚才手打的,没测试,现在可以了
#include<stdio.h> int main(void) { double max; double min; double sum; double score; scanf("%lf",&score); sum=max=min=score; for(int i=1;i<7;i++) { scanf("%lf",&score); sum+=score; max=score>max?score:max; min=score<min?score:min; } printf("AVG=%f\n",(sum-max-min)/5); return 0; }
[ 本帖最后由 lxsjzbd 于 2012-12-6 09:19 编辑 ]