解题思路
#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int* array = new int[n];
for (int i = 0; i < n; i++)
{
cin >> array[i];
}
cout << (array[0] + array[1]) / 2 << " ";
for (int i = 1; i < n - 1; i++)
{
int price = (array[i - 1] + array[i] + array[i + 1]) / 3;
cout << price << " ";
}
cout << (array[n - 1] + array[n - 2]) / 2 << " ";
return 0;
}