资源描述:
《列主元高斯消去法程序.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、程序:#defineN9#include#includevoidmain(){inti,j,t,r;floatp,Lij,max,S;floatX[N];floatA[N][N+1]={31,-13,0,0,0,-10,0,0,0,-15,-13,35,-9,0,-11,0,0,0,0,27,0,-9,31,-10,0,0,0,0,0,-23,0,0,-10,79,-30,0,0,0,-9,0,0,0,0,-30,57,-7,0,-5,0,-20,0,0,0,0,-7,47,-30,0,0,12,0,0,0,0,0,-
2、30,41,0,0,-7,0,0,0,0,-5,0,0,27,-2,7,0,0,0,-9,0,0,0,-2,29,10};for(j=0;jmax){max=A[i][j];r=i;}for(t=j;t3、t]=A[i][t]-Lij*A[j][t];}}printf("输出原方程的解为:");X[N-1]=A[N-1][N]/A[N-1][N-1];for(i=N-2;i>=0;i--){S=A[i][N];for(j=i+1;j