人人终身学习知识网~是各类综合知识资源信息分享,提升综合素质与提高知识技能的终身学习网络平台

 找回密码
 立即注册

QQ登录

只需一步,快速开始

微信登录

微信扫码,快速开始

c语言程序设计题目:计算一元二次方程的根【程序填空】#include//elseif(【?】){x1=(-b+sqrt(disc))/(2*a);x2=(-b-sqrt(disc))/(2*a);printf(quot;hasdistinctrealroots:%8.4fand%.4fnquot;,x1,x2);}else{realpart=-b/(2*a);imagpart=sqrt(-di

[复制链接]

问题:c语言程序设计题目:计算一元二次方程的根【程序填空】#include//elseif(【?】){x1=(-b+sqrt(disc))/(2*a);x2=(-b-sqrt(disc))/(2*a);printf(quot;hasdistinctrealroots:%8.4fand%.4fnquot;,x1,x2);}else{realpart=-b/(2*a);imagpart=sqrt(-di

答案:↓↓↓

网友采纳  #include  //  elseif(disc>0)  {  x1=(-b+sqrt(disc))/(2*a);  x2=(-b-sqrt(disc))/(2*a);  printf("hasdistinctrealroots:%8.4fand%.4fn",x1,x2);  }  else  {  realpart=-b/(2*a);  imagpart=sqrt(-disc)/(2*a);  printf("hascomplexroots:n");  printf("%8.4f+%.4fin",realpart,imagpart);  printf("%8.4f-%.4fin",realpart,imagpart);  }  }  }  2-3-5  theequationhasdistinctrealroots:2.5000and-1.0000  Pressanykeytocontinue
回复

使用道具 举报

小黑屋/人人终身学习知识网~是各类综合知识资源信息分享,提升综合素质与提高知识技能的终身学习网络平台

Powered by 5wangxiao

© 2007-2021 5wangxiao.Com Inc.

快速回复 返回顶部 返回列表