嘿嘿,没有人理我呀,不过没关系,我自己搞定了
#include<iostream.h>
#include<math.h>
#define maxsize 20
#define max 6
double aver(double a[],int n);
double BiaoZhunPianCha(double a[],int n,double x);
double unsure(double ,double);
double unsureRel(double a,double b);
double unsure_mechine();
void dealwith(double &average,double &comp);
int main()
{
double x[max][3],constx,average,comp, dest;
double sum=1,uc=0,buqdd,k,extend;
int n,i;
cout<<"??????????????????"<<endl;
cin>>n;
cout<<"??????????????????"<<endl;
cin>>constx;
for(i=0;i<n;i++)
{
cout<<"??????"<<i+1<<"??±?????????"<<endl;
cin>>x[i][2];
}
cout<<"???????í????"<<endl;
for(i=0;i<n;i++)
{
cout<<"???í??"<<i+1<<"??????"<<endl;
dealwith(average,comp);
x[i][0]=average;
x[i][1]=comp;
cout<<endl;
}
for(i=0;i<n;i++)
{
sum*=pow(x[i][0],x[i][2]);
}
dest=sum*constx;
cout<<"???á???????ù????"<<dest<<endl;
for(i=0;i<n;i++)
uc+=pow(x[i][1]*x[i][2],2);
buqdd=sqrt(uc)*dest;
cout<<"???á????±ê×????·?¨????"<<buqdd<<endl;
cout<<"???á????±ê×????·?¨???à??????"<<buqdd/dest<<endl;
cout<<"?????????????????·?¨?????????ò×?"<<endl;
cin>>k;
extend=k*buqdd;
cout<<"???á???????????·?¨????"<<extend<<endl;
return 0;
}
void dealwith(double
&average,double &comp)
{
int n=0,i,j,choice;
double y[maxsize],unsureA,unsureB,buqdd;
cout<<"?è????????·¨???í?????????è??????1??·??ò????0"<<endl;
cin>>choice;
if(choice==1)
{
do
{
cout<<"?????????í?????????????????????????????ò?á????????????"<<endl;
cin>>n;
}while(n%2!=0);
cout<<"????"<<n<<"????????"<<endl;
for(i=0;i<n;i++)
cin>>y[i];
j=n/2;
for(i=0;i<n/2;i++)
{
y[i]=(y[j]-y[i])/(n/2);
j++;
}
n=n/2;
cout<<"?????ó??×é????????°?????"<<endl;
for(i=0;i<n;i++)
cout<<y[i]<<" ";
cout<<endl;
}
else
{
cout<<"????????????????????"<<endl;
cin>>n;
cout<<"??????????"<<n<<"????????"<<endl;
for(i=0;i<n;i++)
cin>>y[i];
}
average=aver(y,n);
cout<<"???ù????"<<average<<endl;
unsureA=BiaoZhunPianCha(y,n,average);
cout<<"A?à???·?¨????"<<unsureA<<endl;
unsureB=unsure_mechine();
cout<<"B?à???·?¨????"<<unsureB<<endl;
buqdd=unsure(unsureA,unsureB);
cout<<"???????·?¨????"<<buqdd<<endl;
comp=unsureRel(buqdd,average);
cout<<"???????·?¨???à??????"<<comp<<endl;
}
double aver(double a[],int n)
{
int i;
double sum=0;
for(i=0;i<n;i++)
sum+=a[i];
return sum/n;
}
double BiaoZhunPianCha (double a[],int n,double aver)
{
double sum=0,y,z;
int i;
if(n==1)
{
cout<<"???§??????0"<<endl;
return 0;
}
for(i=0;i<n;i++)
sum=sum+pow((a[i]-aver),2);
y=sqrt(sum/(n-1));
cout<<"???§??????"<<y<<endl;
z=y/sqrt(n);
return z;
}
double unsureRel(double a,double b)
{
return a/b;
}
double unsure(double unsureA,double unsureB)
{
double y;
y= sqrt(unsureB*unsureB+unsureA*unsureA);
return y;
}
double unsure_mechine()
{
int n,i;
cout<<"???????????÷???????·?¨????·???????"<<endl;
cin>>n;
double x,y,sum=0;
for(i=0;i<n;i++)
{
cout<<"????????"<<i+1<<"??·????????í?ó????"<<endl;
cin>>x;
cout<<"????????"<<i+1<<"??·?????·????ò×?"<<endl;
cin>>y;
sum+=pow((x/y),2);
}
return sqrt(sum);
}