int a1, b1, c1, a2, b2, c2,x=0,y=0;
int det;
cout << "Enter Input {a1 b1 c1} : ";
cin >> a1 >> b1 >> c1;
cout << "Enter Input {a2 b2 c2} : ";
cin >> a2 >> b2 >> c2;
int m1[3] = { a1,b1,c1 };
int m2[3] = { a2,b2,c2 };
det = (a1*b2) - (a2*b1);
x = ((c1*b2) - (c2*b1)) / det;
y = ((a1*c2) - (a2*c1)) / det;
cout << "x = " << x << endl;
cout << "y = " << y << endl;
ไม่มีความคิดเห็น:
แสดงความคิดเห็น