题目的结果是69.399994吗?
怎么才能输出2位小数?
int i=0, j=0, n=0, min=0, max=0,sum=0;
int a[7];
for (i = 0; i < 7; i++)
scanf_s("%d,", &a[i]);
if (min>a[i])
{min = a[i + 1];
a[i] = min;
a[i] = a[i + 1];}
if (max < a[j])
{max = a[j - 1];
a[j] = max;
a[j] = a[j - 1];}
{min = a[1];
max = a[7];}
sum = a[2] + a[3] + a[4] + a[5] + a[6];
n = (sum / 5);
printf("%5.2f",(float) n);
return 0;
}
举报