#include
#include
#include
int main ()
{
float det2(float,float,float,float);//建议:没有返回值就把float写成void
float det3(float,float,float,float,float,float,float,float,float);//建议1:下面det3有9个参数,这里只有6个这里加三个float;建议2:没有返回值就把float写成void
float a11,a12,a13,a21,a22,a23,a31,a32,a33;
printf ("\nenter the number for the a11 a12 a13:");//建议:不用以来就空格吧
scanf ("%f%f%f",&a11,&a12,&a13);
printf ("\nenter the mnmber for the a21 a22 a23:");
scanf ("%f%f%f",&a21,&a22,&a23);
printf ("\nenter the number for a31 a32 a33:");
scanf ("%f%f%f",&a31,&a32,&a33);
det2(a11,a22,a12,a21);
det3(a11,a12,a13,a21,a22,a23,a31,a32,a33);
system("pause");
return 0;
}
void det2(float a11,float a22,float a12,float a21)
{
float A;//没有分号
A = a11*a22-a21*a12;//没有分号
printf("the result of det2 is %f\n",A);
}
void det3(float a11,float a12,float a13,float a21,float a22,float a23,float a31,float a32,float a33/*少了个空格*/)//;多了个分号
{
//det2 det2(float a11,float a22,float a12,float a21)//这里怎么又有个det2的定义?
float B= a11*(a22*a33-a23*a32)-a21*(a12*a33-a32*a13)+a31*(a12*a23-a22*a13);//B未声明,而且还是少分号
printf("the result of det3 is %f\n",B);
}
哪里错了?