• 2021-04-14
    下列程序运行时输入:20 30 5 85 40,运行结果为:






    #include
    #define N 5
    int main(void)
    {
    int a[N],max,min,sum,i;
    for (i=0;i
    scanf("%d",&a[i]);
    sum=max=min=a[0];
    for (i=1;i
    {
    sum+=a[i];
    if (a[i]>max) max=a[i];
    if (a[i]
    }
    printf("max=%d
    min=%d
    sum=%d
    aver=%4.2f
    ",max,min,sum,(float)(sum-max-min)/(N-2));
    return 0;
    }
  • 举一反三