Quick actions

cmd+k|ctrl+k

Navigation

Languages

lab4(159)

Snippet info

Language

Cpp

Visibility

public

Author

andrusus.korotkovus

Created

2018-10-25T17:58:38Z

Updated

2018-10-25T17:58:38Z

#include <iostream>
using namespace std;

int main() {
    float a1, a2, b1, b2, c1, c2, x, y, z;
    cin>>a1>>a2>>b1>>b2>>c1>>c2;
    c1 = a1*x+b1*y;
    x = c1/a1 - (b1*y)/a1;
    c2 = a2*x+b2*y;  //c2 = a2*(c1/a1 - (b1*y)/a1)+b2*y;
    c2 = a2*(c1/a1)-a2*((b1*y)/a1) + b2*y;
    z = b1+b2;
    y = (c2 - (a2*(c1/a1) - a2*(z/a1)))/z;
    x = c1/a1 - (b1*y)/a1;
    cout<<x<<" "<<y;
     
    
    return 0;
}
INFO