用公式法求方程x2-2x+1=0的两个根.

用公式法求方程x2-2x+1=0的两个根.

答案

解析:

a=1;

b=-2;

c=1;

d=b*b-4*a*c;

if  d<0

   disp(“no solution”);

else

    t=sqrt(d);

    x1=(-b+t)/(2*a);

    x2=(-b-t)/(2*a);

print(%io(2),x1,x2);

end

相关题目

________that the government can lead them out of the financial crisis,people
________that the government can lead them out of the financial crisis,people are optimistic about the future of the country. A.Convincing  B.Convinced C.To convince      D.Having con
办公大楼的大门能“看到”人的到来或离开而自动开和关,
办公大楼的大门能“看到”人的到来或离开而自动开和关,利用了下面哪种传感器(  )                                         
写出下列反应的化学方程式,并注明反应的基本类型。 (1)镁
写出下列反应的化学方程式,并注明反应的基本类型。 (1)镁粉用于制照明弹:             、          。 (2)用锌与稀硫酸反应制取氢气: 
 若一个直角三角形的三条边长是三个自然数,其中有两边的
 若一个直角三角形的三条边长是三个自然数,其中有两边的长分别为6和10,那么这个三角形的第三条边长是______.
已知,,,,则以OC、OD为邻边的平行四边形OCED的对角线OE的长为___
已知,,,,则以OC、OD为邻边的平行四边形OCED的对角线OE的长为__________.
You are a German living in Berlin. One day you’ re walk??ing down the street,
You are a German living in Berlin. One day you’ re walk??ing down the street, minding your own business, when sudden??ly a stranger comes up with a smile on his face. After stopping you, he holds a
选出下列各句中没有语病的一句,并说说其他句子哪里有毛
选出下列各句中没有语病的一句,并说说其他句子哪里有毛病,如何改正。 A. 近日新区法院审结了这起案件,违约经营的小张被判令赔偿原告好路缘商
如图所示,在波的传播方向上有间距均为l.0m的六个质点a、b
如图所示,在波的传播方向上有间距均为l.0m的六个质点a、b、c、d、e、f,均静止在各自的平衡位置。一列横波以l.0m/s的速度水平向右传播,t=0时到达

最新题目