#34733: C++


1554101-0@g.puiching.edu.mo (P5A29)

學校 : 澳門培正中學
編號 : 216811
來源 : [202.86.172.162]
最後登入時間 :
2023-10-16 13:14:52
a410. 解方程 -- TYVJ | From: [27.109.151.69] | 發表日期 : 2023-04-11 20:30

#include <bits/stdc++.h>
using namespace std;
int main(){
double a,b,c,d,e,f;
while(cin>>a>>b>>c>>d>>e>>f){
if(a*e==d*b){
if(a*f==c*d)cout << "Too many\n";
else cout << "No answer\n";
}else{
double x=(c*e-b*f)/(a*e-b*d);
double y=(c*d-a*f)/(b*d-a*e);
cout << "x=" << fixed << setprecision(2) << x << endl;
cout << "y=" << fixed << setprecision(2) << y << endl;

}
}
}
 
ZeroJudge Forum