卖菜
from CCF-CSP 2018-09-1
Time limit:1s
Memory limit:256MB
ac代码:
#include<iostream>
using namespace std;
int x[1005],n;
int main(){
cin>>n;
for(int i = 1;i <= n;++i)
cin>>x[i];
cout<<(x[1] + x[2]) / 2;
for(int i = 2;i < n;++i)
cout<<" "<<(x[i - 1] + x[i] + x[i + 1]) / 3;
cout<<" "<<(x[n - 1] + x[n]) / 2;
return 0;
}