#数值运算 a=float(input()) b=float(input()) c=float(input()) import math x=(-b+math.sqrt(b*b-4*a*c))/(2*a) print(round(x,2))
为啥当我输入三行的数字分别是(1,2,1)的时候,结果是-1.0,只有保留一位小数,其次,要怎么这个解决问题
收起
试试format控制格式
报告相同问题?