这个用变量定义数组orzz支持吗?建议改为:int a[1000];int n;cin>>n;......
printf("%0.2lf",average); 改为cout输出 cout<<setprecision(2)<<average<<endl;