![]() |
#2
rjsp2016-03-03 23:00
|
只有本站会员才能查看附件,请 登录

#include"iostream"
#include <iomanip>
using namespace std;
int main()
{
int *judger, n,count;
double avg;
while (cin >> n)
{
if (n > 2 && n <= 100)
{
avg = 0;
judger = (int*)calloc(n, sizeof(int));
for (count = 0; count < n; count++)
{
cin >> judger[count];
}
for (count = 1; count < n - 1; count++)
{
avg += judger[count];
}
avg = avg / (n - 2);
cout << fixed << setprecision(2) << avg << endl;
}
}
}
#include <iomanip>
using namespace std;
int main()
{
int *judger, n,count;
double avg;
while (cin >> n)
{
if (n > 2 && n <= 100)
{
avg = 0;
judger = (int*)calloc(n, sizeof(int));
for (count = 0; count < n; count++)
{
cin >> judger[count];
}
for (count = 1; count < n - 1; count++)
{
avg += judger[count];
}
avg = avg / (n - 2);
cout << fixed << setprecision(2) << avg << endl;
}
}
}