杭电OJ2014 wrong answer 题目见正文
程序代码:
#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; } } }