412-20 guruh talabasi Aliqulov Shaxboz
2-mavzu bo'yicha laboratoriya yechimlari
2-topshiriq:Berilgan koeffitsient va o‘ng tomon qiymatlarida tenglamalar sistemasining determinanti noldan farqli deb hisoblab sistema yechimi topilsin:
=================================================
#include
#include
using namespace std;
int main()
{ float a1, a2, b1, b2, c1, c2;
float x, y;
cout << "a1=" ; cin >> a1;
cout << "b1=" ; cin >> b1;
cout << "c1=" ; cin >> c1;
cout << "a2=" ; cin >> a2;
cout << "b2=" ; cin >> b2;
cout << "c2=" ; cin >> c2;
y = ((a2 / a1)*c1 - c2) / ((a2 / a1)*b1 - b2);
x = (c1 - b1*y) / a1;
cout << "x=" << x << " y=" << y;
_getch();
return 0; }
==================================================
Do'stlaringiz bilan baham: |