首页上一页 1  下一页尾页 3 条记录 1/1页
        二元一次不定方程
                 	
                        发表在C语言图书答疑
                        2015-12-16                                                
                    		
                                                                            	
                        
                        
                    
                    
                    	是否精华
                    	是
                    	否
                    
                    
                    
                            版块置顶:
                            是
                            否
                        
                    
                                           感觉这句有点问题cout<<"y="<<c/a<<"-"<<(b/a)<<"x"<<endl;
不应该是cout << "y=" << c/b << "-" << (a/b) << "x" << endl;吗
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
cout<<"请依次输入系数a、b、c:"<<endl;
int a,b,c;
cin>>a;
cin>>b;
cin>>c;
if(a<=0||b<=0||a<b)
{
cout<<"输入无效,请确认系数a>0,b>0并且a>=b"<<endl;
}
cout<<"方程"<<a<<"x+"<<b<<"y="<<c<<"的解为:"<<endl;
cout<<"y="<<c/a<<"-"<<(b/a)<<"x"<<endl;
return 0;
}
                
        	
        
        
    不应该是cout << "y=" << c/b << "-" << (a/b) << "x" << endl;吗
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
cout<<"请依次输入系数a、b、c:"<<endl;
int a,b,c;
cin>>a;
cin>>b;
cin>>c;
if(a<=0||b<=0||a<b)
{
cout<<"输入无效,请确认系数a>0,b>0并且a>=b"<<endl;
}
cout<<"方程"<<a<<"x+"<<b<<"y="<<c<<"的解为:"<<endl;
cout<<"y="<<c/a<<"-"<<(b/a)<<"x"<<endl;
return 0;
}

 
	
                                                 VIP会员
VIP会员 购物车
购物车

 私信
                         私信 
                     发表新帖
发表新帖 立即签到
立即签到 
        		  
        		 
         		 关注
关注
                  回复
 回复 支持(
                	支持( 反对(
                    反对( 
               			  
                







 
                     
                     
					 
						 
						 
						 
						