注意输入顺序

来源:互联网 发布:人生真相知乎 编辑:程序博客网 时间:2024/06/01 10:08
<span style="box-sizing: border-box; color: rgb(88, 102, 110); font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, 微软雅黑, 黑体, sans-serif; font-size: 24px; line-height: 26.3999996185303px; background-color: rgb(240, 243, 244);">2631 解二元一次方程</span>
<span style="box-sizing: border-box; color: rgb(88, 102, 110); font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, 微软雅黑, 黑体, sans-serif; font-size: 24px; line-height: 26.3999996185303px; background-color: rgb(240, 243, 244);"></span>
#include<iostream>using namespace std;int main(){int a1,a2,b1,b2,c1,c2;
cin>>a1>>b1>>c1>>a2>>b2>>c2;
int y = (c2*a1 - a2*c1) / (b2*a1 - a2*b1);cout<<"x="<<(c1 - b1*y) / a1<<endl;cout<<"y="<<y;return 0;}

0 0
原创粉丝点击