小编use*_*251的帖子

求解具有两个未知数的两个方程的系统

求解下面两个未知数的两个方程组的系统:

在此输入图像描述

a1,b1,c1,a2,b2和c2由用户自己输入.

我一直试图找到问题的数学解决方案,我似乎无法走远...

到目前为止我尝试过的是:

  1. 从第一个方程找到y.(b1y = c1-a1x,y =(c1-a1x)/ b1)
  2. 然后我在第二个等式中替换y,得到一个方程式,其中1个未知数,在这种情况下为x.但是,我无法解决这个等式,我得到了一些奇数/方程式并停在这里.

这是正确的还是有更简单的方法来做到这一点?

当前代码:

#include <iostream>

using namespace std;

int main()
{
    int a1, b1, c1, a2, b2, c2;
    cout << "Enter the values for the first equation." << endl;
    cout << "Enter the value for a1" << endl;
    cin >> a1;
    cout << "Enter the value for b1" << endl;
    cin >> b1;
    cout << "Enter the value for c1" << endl;
    cin >> c1;
    cout << "Enter the values for …
Run Code Online (Sandbox Code Playgroud)

c++ math equation equation-solving

10
推荐指数
1
解决办法
2万
查看次数

标签 统计

c++ ×1

equation ×1

equation-solving ×1

math ×1