using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
Console.Title = "多元一次方程高斯消元列主消元计算";
Console.WindowWidth = 80;
Console.BufferHeight = 100;
//float[,] c = new float[,]
//{
//{ 1, 1, 1,6},
//{ 1, 3, -2 ,1},
//{ 2, -2, 1 ,1}
//};
//float[] res = LieZhuXiaoYuan(c);
while(true)
{
float[,] d = read();
Console.Write("\n\n高斯消元计算\n\n");
GaosiXiaoYuan(d);
Console.Write("\n\n列主消元计算\n\n");
LieZhuXiaoYuan(d);
}
}
private static float[,] read()
{
Console.Write("\n\n\n\n\n");
Console.Write("多元一次方程高斯消元列主消元计算\n");
Console.Write("|-----------------------------\n");
Console.Write("|1.1348 3.8326 1.1651 3.4017 9.5342\n");
Console.Write("|0.5301 1.7875 2.5330 1.5435 6.3941\n");
Console.Write("|3.4129 4.9317 8.7643 1.3142 18.4231\n");
Console.Write("|1.2371 4.9998 10.6721 0.0147 16.9237\n");
Console.Write("|-----------------------------\n");
Console.Write("|请输入系数0,计算例题,如:\n");
string ch = Console.ReadLine();
if(ch == "0")
{
float[,] exp = new float[,]
{
{ 1.1348F, 3.8326F, 1.1651F, 3.4017F, 9.5342F},
{ 0.5301F, 1.7875F, 2.5330F, 1.5435F, 6.3941F},
{ 3.4129F, 4.9317F, 8.7643F, 1.3142F, 18.4231F},
{ 1.2371F, 4.9998F, 10.6721F, 0.0147F, 16.9237F}
&nbs
C# 多元一次方程算法,高斯消元列主消元法比较
最新推荐文章于 2024-03-29 16:35:20 发布