- 2022tysc0306 的博客
线性代数解二元一次方程组
- 2024-4-11 13:31:36 @
#include <iostream>
using namespace std;
int main()
{
double a, b, c, d, e, f;
cout << "请输入以下二元一次方程组中的a.b.c.d.e.f:\n";
cout << " ax + by = c\n dx + ey = f\n";
system("cls");
cin >> a >> b >> c >> d >> e >> f;
double x = (c * e - b * f) / (a * e - b * d);
double y = (a * f - c * d) / (a * e - b * d);
cout << x << " " << y;
return 0;
}