用高斯消元法将方阵变换成下三角矩阵C语言程序
/*
author:liunanyan
date:2019.11.1
function:Transform the square matrix into the lower tringular matrix.
*/
#include<stdio.h>
#include<math.h>
int main(){
double a[4][4] = {
{
3,4,9,10},{
4,8,18,12},{
1,3,9,4},{
6,9,15,10}}; // 输入方阵
int rows = sizeof(a)/sizeof(a[0]);
int cols = sizeof(a[0])/sizeof(a[0][0]); // 获得行列数
int x = rows - 1;
int y = cols - 1;
int m = x;
int n = y;
while(x>=1){
for(int i = x;i>0;i--){
double x_b = a[i-1][y]/a[x][y];
// printf("%lfn",x_b);
for (int j = y;j>=0;j--){
a[i-1][j] &#