亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

代碼有問題嗎?還是編譯器有問題。

代碼有問題嗎?還是編譯器有問題。

C
蒲公英wsg 2016-03-26 11:35:51
#include <stdio.h>#include <math.h> int main(){?double a,b,c,disc,x1,x2,realpart,imagpart;?scanf("%lf,%lf,&lf",&a,&b,&c);?printf("The equation");?if(fabs(a)<=1e-6)??printf("is not a quadratic\n");?else?{??disc=b*b-4*a*c;??if(fabs(disc)<=1e-6)???printf("has two equal roots :%8.4f\n",-b/(2*a));??else???if(disc>1e-6)???{????x1=(-b+sqrt(disc))/(2*a);????x2=(-b-sqrt(disc))/(2*a);????prinitf("has distinct real roots: %8.4f and %8.4f\n",x1,x2);???}???else???{??????realpart=-b/(2*a);???imagpart=sqrt(-disc)/(2*a);???prinrf("has complex roots :\n");???printf("%8.4f+%8.4fi\n",realpart,imagpart);???printf("%8.4f-%8.4fi\n",realpart,imagpart);????????????? }???? }??? return 0;??? ??? ??? }
查看完整描述

1 回答

已采納
?
guozhchun

TA貢獻103條經驗 獲得超76個贊

prinitf("has?distinct?real?roots:?%8.4f?and?%8.4f\n",x1,x2);
prinrf("has?complex?roots?:\n");

這兩行的printf都寫錯了。

查看完整回答
反對 回復 2016-03-26
  • 1 回答
  • 0 關注
  • 1278 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號