谢谢各位啦。我会努力..
#include<iostream> using namespace std; int main() { const int MAX=100; float f_var[MAX]={0}; double sum=0.0; for (int i=0;i!=MAX;++i) { cin>>f_var[i]; sum+=f_var[i]; } float avg=sum/MAX; cout<<avg<<endl; for (int i=0;i!=MAX;++i) { cout<<(f_var[i]-avg>0?f_var[i]-avg:-(f_var[i]-avg))<<" "; if (i%10==0) cout<<endl; } return 0; }