#include <iostream> const int Size=10; void in_score(int *,int *); void disp_score(const int *,int); void average_score(const int *,int); int main() { int score[Size],l; in_score(score,&l); disp_score(score,l); average_score(score,l); return 0; } void in_score(int *p,int *s) { using namespace std; int i=0; cout<<"Please enter the scores and end by Q: "<<endl; cout<<"No. "<<i+1<<" : "; while(cin>>*(p+i)) { i++; cout<<"No. "<<i+1<<" : "; } *s=i; } void disp_score(const int *p,int s) { using namespace std; int i=0; cout<<"All of the "<<s<<" scores: "; while(i<s) { cout<<" "<<*(p+i); i++; } cout<<endl; } void average_score(const int *p,int s) { using namespace std; int total=0,i=0; while(i<s) { total+=*(p+i); i++; } cout<<"The average score of "<<s<<" scores is: "<<double(total)/s<<endl; } 这个做的有点困惑