展开全部
不好意思,没看清题目
#include<iostream>
using namespace std;
void main()
{
float a,b,c,d,e,f;
cout<<"请输入二元一次方程组\n"
<<"ax+by+c=0\n"
<<"dx+ey+f=0\n";
cout<<"a=";
cin>>a;
cout<<"b=";
cin>>b;
cout<<"c=";
cin>>c;
cout<<"d=";
cin>>d;
cout<<"e=";
cin>>e;
cout<<"f=";
cin>>f;
if(a*e==b*d)
cout<<"方程组无解。\n";
else
{
cout<<"x="<<(b*f-e*c)/(a*e-b*d)<<endl;
cout<<"y="<<(a*f-d*c)/(b*d-a*e)<<endl;
}
}
#include<iostream>
using namespace std;
void main()
{
float a,b,c,d,e,f;
cout<<"请输入二元一次方程组\n"
<<"ax+by+c=0\n"
<<"dx+ey+f=0\n";
cout<<"a=";
cin>>a;
cout<<"b=";
cin>>b;
cout<<"c=";
cin>>c;
cout<<"d=";
cin>>d;
cout<<"e=";
cin>>e;
cout<<"f=";
cin>>f;
if(a*e==b*d)
cout<<"方程组无解。\n";
else
{
cout<<"x="<<(b*f-e*c)/(a*e-b*d)<<endl;
cout<<"y="<<(a*f-d*c)/(b*d-a*e)<<endl;
}
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询