cái này bị lỗi gì vậy? fix giùm em với.....
#include<iostream>
using std::cout;
using std::cin;
using std::endl;
float fDinhthuc(float A[][256],unsigned char n)
{
if(n<2) return A[0][0];
else if(n>=2)
{
float x,temp[n-1][n-1];unsigned char l=0;
for(unsigned char i=0;i<n;i++)
{
for(unsigned char z=1;z<n;z++)
{
l=0;
for(unsigned char y=0;y<n
{
if(y!=i)
{
temp[z-1][l]=A[z][y];
l++; y++;
}
else y++;
}
}
if(i%2==0) x=(A[0][i]*fDinhthuc(temp,n-1));// dong nay bi loi
else x=(-A[0][i]*fDinhthuc(temp,n-1));//dong nay bi loi
}
return x;
}
}
#include<iostream>
using std::cout;
using std::cin;
using std::endl;
float fDinhthuc(float A[][256],unsigned char n)
{
if(n<2) return A[0][0];
else if(n>=2)
{
float x,temp[n-1][n-1];unsigned char l=0;
for(unsigned char i=0;i<n;i++)
{
for(unsigned char z=1;z<n;z++)
{
l=0;
for(unsigned char y=0;y<n
{
if(y!=i)
{
temp[z-1][l]=A[z][y];
l++; y++;
}
else y++;
}
}
if(i%2==0) x=(A[0][i]*fDinhthuc(temp,n-1));// dong nay bi loi
else x=(-A[0][i]*fDinhthuc(temp,n-1));//dong nay bi loi
}
return x;
}
}
Comment