#include<iostream.h>
int fun(double &ave);
main()
{
int n,k=0,s=0;
double ave
cout<<"input integers:";
while(1);
{
cin>>n;
if(n<=0)
break;
k++;
s+=n;
}
cout<<"k="<<k<<'\t'<<"ave="<<ave<<endl;
int fun(double &ave)
{
if(n<=0)
return 1;
&ave=s/k;
return 0;
}
大家帮我看看吧.由于是初学者,所以肯定有低级错误的.希望大家多多包函啊