标题:求二元方程在根?看看那里不对?
取消只看楼主
wszxj2008
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2007-6-5
 问题点数:0 回复次数:0 
求二元方程在根?看看那里不对?
#include<iostream.h>
#include<math.h>
void main()
{
    double a,b,c,x1,x2,m;
    cout<<"please input  three  nummber  for  a   b   c  :"<<endl;
    cin>>a>>b>>c;
 
    m=(b*b-4*a*c);
    if(m<0)
        cout<<"the  fang cheng  isn't   answer:"<<endl;


    else
    {

    x1=(-b+sqrt(m))/(2*a);
    x2=(-b-sqrt(m))/(2*a);
    cout<<"x1="<<x1<<"x2="<<x2<<endl;
    }



    }
搜索更多相关主题的帖子: 方程 
2008-03-19 14:38



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-204195-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.204441 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved