c语言 列主元素消去法求方程组想问下我这道题错在哪里?#include #include void main(){float a[4][4]={{0,0,0,0},{0,1,2,3},{0,2,1,3},{0,3,2,1}},b[4]={0,8,22,28},d,t,sum=0;int i,j,k,l;for(k=1;kfabs(d)){d=a[i][k];l=i;}if(d==0)break;els
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/23 05:49:23
c语言 列主元素消去法求方程组想问下我这道题错在哪里?#include #include void main(){float a[4][4]={{0,0,0,0},{0,1,2,3},{0,2,1,3},{0,3,2,1}},b[4]={0,8,22,28},d,t,sum=0;int i,j,k,l;for(k=1;kfabs(d)){d=a[i][k];l=i;}if(d==0)break;els
c语言 列主元素消去法求方程组
想问下我这道题错在哪里?
#include
#include
void main()
{
float a[4][4]={{0,0,0,0},{0,1,2,3},{0,2,1,3},{0,3,2,1}},b[4]={0,8,22,28},d,t,sum=0;
int i,j,k,l;
for(k=1;kfabs(d))
{
d=a[i][k];
l=i;
}
if(d==0)
break;
else if(d!=0)
if(l!=k)
for(j=k;j
c语言 列主元素消去法求方程组想问下我这道题错在哪里?#include #include void main(){float a[4][4]={{0,0,0,0},{0,1,2,3},{0,2,1,3},{0,3,2,1}},b[4]={0,8,22,28},d,t,sum=0;int i,j,k,l;for(k=1;kfabs(d)){d=a[i][k];l=i;}if(d==0)break;els
楼主粗心了点吧
1 #include
2 #include
3 void main()
4 {
5 float a[4][4] = { {0,0,0,0},{0,1,2,3},{0,2,1,3},{0,3,2,1} },b[4] =
6 {
7 0,8,22,28},d,t,sum = 0;
8 int i,j,k,l;
9 for (k = 1; k fabs(d))
15 {
16 d = a[i][k];
17 l = i;
18 }
19 if (d == 0)
20 break;
21 else if (d != 0)
22 if (l != k)
23 for (j = k; j